Add query_options model config for SQL Server OPTION clauses (#613).#674
Merged
axellpadilla merged 7 commits intoJun 2, 2026
Merged
Conversation
…t#613). Supports a dict form (allowlisted hints; MAX_GRANT_PERCENT / MIN_GRANT_PERCENT use `=` syntax) and a query_options_raw escape hatch. Honoured on table, incremental (delete+insert, merge, microbatch), snapshot, and unit_test materializations; view raises a compiler error if set. apply_label() is preserved as a backward-compat alias emitting only the LABEL hint.
axellpadilla
requested changes
May 21, 2026
- Drop `| int` cast so MAX_GRANT_PERCENT / MIN_GRANT_PERCENT render decimals verbatim (SQL Server accepts 0.0–100.0). - Remove PARAMETERIZATION from the allowlist — its SIMPLE/FORCED syntax cannot be rendered through the numeric value path. Users needing it can fall back to query_options_raw. - Reject string/mapping values for query_options_raw to prevent silent character-by-character iteration when a non-list is passed. - Sharpen the apply_label() deprecation comment to direct overriders to get_query_options() as the new extension point. - Add CHANGELOG v1.10.0 entry covering the new configs and the apply_label override migration note. - Add tests covering decimal MAX_GRANT_PERCENT, query_options_raw string rejection, and PARAMETERIZATION now hitting the invalid-key branch.
…query-options. Brings in 21 commits from upstream that were missing from this branch (view materialization improvements, multi-database catalog support, TABLOCK on contract-enforced inserts, reserved-keyword quoting fix, default-schema-concat flag, etc.). Conflict in dbt/include/sqlserver/macros/adapters/catalog.sql resolved by keeping upstream's multi-database structure while replacing the remaining apply_label() call with get_query_options().
for more information, see https://pre-commit.ci
axellpadilla
approved these changes
May 31, 2026
Your right it is, when I did the first pass it was not. Co-authored-by: Axell Padilla <68310020+axellpadilla@users.noreply.github.com>
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.
Supports a dict form (allowlisted hints; MAX_GRANT_PERCENT / MIN_GRANT_PERCENT use
=syntax) and a query_options_raw escape hatch. Usable on table, incremental (delete+insert, merge, microbatch), snapshot, and unit_test materializations.Usage on a view raises a compiler error if set.
Apply_label() is preserved as a backward-compat alias emitting only the LABEL hint.
Fixes #613