Repository navigation
Conversation
SQLBuild's lexical rules gave Databricks and DuckDB one shared entry with no backslash escapes, no raw strings and flat block comments. SQLQuack and both adapters read them differently: Databricks honours a backslash in '...' and "..." outside r'...' raw strings, DuckDB honours it inside E'...', and both nest block comments. The expression-macro dedent in sqb format reads the formatted body with these rules. A multi-line string after a backslash-escaped quote looked closed early, so its next line lost two spaces on every run and the string's value changed. Databricks now has its own entry, and DuckDB uses the PostgreSQL rules its adapter already declares. The same rules decide quoted text for semantic-validation normalisation, fast lineage, dynamic pivot, SQL tree nodes and query-facts shapes.
kvlonge
enabled auto-merge
November 15, 2026 15:44
kvlonge
added this pull request to the merge queue
Nov 15, 2026
Any commits made after this event will not be merged.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 15, 2026
kvlonge
added this pull request to the merge queue
Nov 15, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
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.
Why
sqb formatre-indents expression macro bodies using SQLBuild's lexical rules for the project's dialect. Databricks and DuckDB shared one entry with no backslash escapes, no raw strings and flat block comments. SQLQuack and both adapters read them differently: Databricks honours\'in'...'and"..."outsider'...', DuckDB honours it insideE'...', and both nest block comments. A multi-line string after\'therefore looked closed early, and its next line lost two spaces on every run, changing the value (6 → 4 → 2 → 0 spaces) sosqb format --checknever settled.Changes
'and", ther'...'raw prefix and nested block comments.E'...'escapes, nested block comments), as its adapter already declares.E''and a nested comment holding an apostrophe; the CLI format test now covers Databricks and DuckDB projects.Verification
sqb formatthree times on the repro macro: before,kept indentloses two spaces per run on both dialects; after, it keeps all six on every run.cargo test -p sqlbuild-sqltext -p sqlbuild-rules -p sqlbuild-analysis --lib,make testandmake check-cipass.