Skip to content

fix: distinguish Snowflake START WITH from CTEs - #738

Merged
chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/snowflake-start-with-lint
Sep 18, 2026
Merged

chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/snowflake-start-with-lint

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Why

Snowflake hierarchy queries use START WITH inside ordinary query scopes. The SQL Rule tokenizer treated every nested WITH token as a nested CTE, producing a false SQBRSQL036 finding for valid hierarchy syntax.

Changes

  • recognize WITH preceded by the previous significant START token as hierarchy syntax
  • retain nested CTE and recursive CTE detection for all other WITH tokens
  • add focused regression coverage with a hierarchy query inside a top-level CTE

Verification

  • focused native SQL-lint test
  • cargo clippy -p sqlbuild-rules-native --all-targets --all-features -- -D warnings
  • make check-ci
  • cache-free compile of a downstream Snowflake hierarchy model: 0 errors, 0 warnings
  • independent focused review
  • public repository hygiene scan

@chio-labs-delivery
chio-labs-delivery Bot enabled auto-merge (squash) September 18, 2026 12:24
@chio-labs-delivery
chio-labs-delivery Bot merged commit b39bd91 into main Sep 18, 2026
18 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the fix/snowflake-start-with-lint branch September 18, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant