Skip to content

Commit 462c797

Browse files
fix: add db2 to FORBIDDEN_STATE_SYNC_ENGINES
Db2 rejects table names starting with underscore, which SQLMesh uses for all state tables (_versions, _snapshots, _environments, _intervals). Without this entry is_forbidden_for_state_sync() returns False for Db2, allowing SQLMesh to silently attempt — and fail — to create state tables instead of raising a clear ConfigError upfront. The comment explaining the reason has been moved inside the set alongside the entry it describes, consistent with the pattern used for the other engines in the set. Signed-off-by: IBM Db2 Eco System <Hdm-dev-persona-db2-eco-system@ibm.com>
1 parent efa09d4 commit 462c797

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎sqlmesh/core/config/connection.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@
5353
"mssql",
5454
"azuresql",
5555
}
56-
# Note: Db2 is excluded because it doesn't allow table names starting with underscore (_)
57-
# which SQLMesh uses for state tables (_versions, _snapshots, _environments, _intervals).
58-
# Use a separate state_connection (e.g., DuckDB) for Db2 gateways.
5956
FORBIDDEN_STATE_SYNC_ENGINES = {
6057
# Do not support row-level operations
6158
"spark",
6259
"trino",
6360
# Nullable types are problematic
6461
"clickhouse",
6562
"starrocks",
63+
# Db2 rejects table names starting with underscore (_versions, _snapshots,
64+
# _environments, _intervals). Use a separate state_connection (e.g., DuckDB).
65+
"db2",
6666
}
6767
MOTHERDUCK_TOKEN_REGEX = re.compile(r"(\?|\&)(motherduck_token=)(\S*)")
6868
PASSWORD_REGEX = re.compile(r"(password=)(\S+)")

0 commit comments

Comments
 (0)