feat(sqlserver): Part 7 — adapter_impl.rs match arms - #17
Merged
Conversation
Resolves all 33 E0004 non-exhaustive-match errors in adapter_impl.rs
that blocked a full dbt-adapter crate build, by adding a SqlServer arm
(or joining an existing group) at every site the compiler flagged.
Grouping decisions, verified against v1 dbt-sqlserver and the shared
macro packages rather than assumed identical to Fabric:
- valid_incremental_strategies: matches Fabric's set exactly — v1's
SQLServerAdapter.valid_incremental_strategies() returns the same
four strategies.
- list_schemas_inner's schema column name ("schema"): confirmed via
v1's sqlserver__list_schemas, which selects `name as [schema]`.
- standardize_grants_dict: joins the Postgres/Bigquery/DuckDB/Alt
group (grantee/privilege_type columns), not the "grants not
implemented" bucket — v1's sqlserver__get_show_grant_sql selects
exactly those two column names, and SQLServerAdapter doesn't
override standardize_grants_dict, so it falls through to that same
base implementation.
- truncate_relation and get_columns_in_relation's macro-dispatch
group: v1 has sqlserver__truncate_relation and
sqlserver__get_columns_in_relation macros, so SqlServer joins the
macro-based groups rather than any unimplemented bucket.
- get_constraint_support: v1's SQLServerAdapter.CONSTRAINT_SUPPORT
overrides all five constraint types to Enforced (including Check,
unlike Fabric which marks Check NotSupported) — ported as its own
block rather than folded into Fabric's.
- verify_database: this method is only invoked from the dbt-postgres
and dbt-redshift macro packages (grep confirms no other package
calls adapter.verify_database), which SQL Server's macro package
never dispatches into, so SqlServer joins the "unimplemented"
bucket alongside Fabric/Snowflake/Databricks rather than the
Postgres/DuckDB/Alt/ClickHouse single-database-check group — despite
SQL Server otherwise supporting cross-database three-part names.
- Every purely BigQuery- or Databricks-specific method (partition
config, dataset location, table options, DBR capabilities, Iceberg
helpers, etc.) gets SqlServer added to the existing "unimplemented"
bucket alongside every other non-BigQuery/non-Databricks adapter.
- adapter_specific_behavior_flags: returns vec![] for SqlServer. v1
registers 5 behavior flags, but 4 (default_schema_concat,
native_string_types, safe_type_expansion, use_dbt_transactions) are
staying on their v1 default with no alternate code path in the Rust
adapter yet, and the 5th (disable_empty_relation_aliases) is out of
scope here — so none are registered rather than declaring toggles
the adapter doesn't yet honor. Follow-up if/when those paths land.
Closes #7
axellpadilla
changed the base branch from
part-6-sqlserver-types
to
sqlserver-v2-port
August 3, 2026 01:18
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #16 (Part 6).
Resolves all 33
E0004non-exhaustive-match errors inadapter_impl.rs— the last remaining compile-error backlog blocking a fulldbt-adaptercrate build for SQL Server. Each site got aSqlServerarm or was folded into an existing group, verified against v1dbt-sqlserverand the shared macro packages rather than assumed identical to Fabric.Where it matches Fabric exactly
valid_incremental_strategies: same four strategies — v1'sSQLServerAdapter.valid_incremental_strategies()returns the identical list.list_schemas_inner's"schema"column name: confirmed via v1'ssqlserver__list_schemas, which selectsname as [schema].describe_dynamic_table, etc.): SqlServer joins the existing "unimplemented" bucket alongside Fabric and the other non-BigQuery/non-Databricks adapters.Where it diverges
get_constraint_support: v1'sSQLServerAdapter.CONSTRAINT_SUPPORToverrides all five constraint types toEnforced— includingCheck, unlike Fabric which marksCheckNotSupported. Given its own block rather than folded into Fabric's.standardize_grants_dict: joins the Postgres/Bigquery/DuckDB/Alt group (grantee/privilege_typecolumns), not the "grants not implemented" bucket. v1'ssqlserver__get_show_grant_sqlselects exactly those two column names, andSQLServerAdapterdoesn't overridestandardize_grants_dict, so it falls through to the same base implementation those adapters use.truncate_relationandget_columns_in_relation's macro-dispatch group: v1 hassqlserver__truncate_relationandsqlserver__get_columns_in_relationmacros, so SqlServer joins the macro-based groups rather than any unimplemented bucket.verify_database: joins the "unimplemented" bucket (Fabric/Snowflake/Databricks/Salesforce) rather than the Postgres/DuckDB/Alt/ClickHouse single-database-check group, despite SQL Server otherwise supporting cross-database three-part names. This method is only invoked from thedbt-postgresanddbt-redshiftmacro packages — grepping the loader's macro assets turns up no other caller — and SQL Server's own macro package never dispatches into either.Left alone
adapter_specific_behavior_flags: returnsvec![]for SqlServer. v1 registers 5 behavior flags, but 4 (dbt_sqlserver_use_default_schema_concat,dbt_sqlserver_use_native_string_types,dbt_sqlserver_enable_safe_type_expansion,dbt_sqlserver_use_dbt_transactions) stay on their v1 default with no alternate code path in the Rust adapter yet (e.g. Part 6 hardcoded the native-string-type mapping unconditionally, with no legacy branch reading the flag), and the 5th (dbt_sqlserver_disable_empty_relation_aliases) is out of scope here. None are registered rather than declaring toggles the adapter doesn't yet honor — worth a follow-up once/if those code paths land.Verification
cargo check -p dbt-adapter --tests: clean, 0 errors.cargo build -p dbt-adapter: clean.cargo test -p dbt-adapter --lib: 891 passed, 0 failed.cargo fmt: applied.This closes out the full compile-error backlog for the
dbt-adaptercrate — Parts 4/5/6/7 combined leave it building clean end to end.Closes #7