…LQuack 0.6.0 does
SQLQuack 0.6.0 changes three layout rules, and SQLClean's formatter is
SQLQuack's:
- A clause with a single short item stays on its header line
(ORDER BY a DESC, GROUP BY customer_id, JOIN b ON b.id = a.id).
- A parenthesised group that spans lines gets its own lines instead of
hugging the call's parenthesis (ARRAY(\n (\n SELECT ...)).
- A window specification too wide for one line is broken into
PARTITION BY, ORDER BY and frame lines.
Parse errors now name what was expected ("Expected an expression after
BY") instead of the unexpected token.
The format corpus records the old layout as previously_formatted, and
one SQL Server departure is dropped because SQLQuack now matches
SQLClean's recorded layout.
Why
SQLClean's formatter is SQLQuack's. SQLQuack 0.6.0 (tag v0.6.0,
8d28aa4c4b6c3d8c5345ddef3d620fa24e26741a) changes three layout rules, so SQLClean output changes with it. SQLBuild links SQLClean and SQLQuack into one binary, so both must pin the same revision.Changes
Cargo.toml/Cargo.lock: everysqlquack-*pin moves frome1a583eb(0.5.1) to8d28aa4c(0.6.0).ORDER BY\n a DESC→ORDER BY a DESC;JOIN b\n ON b.id = a.id→JOIN b ON b.id = a.id.ARRAY((\n SELECT …\n))→ARRAY(\n (\n SELECT …\n )\n).SUM(x) OVER (PARTITION BY y ORDER BY interval ROWS BETWEEN …)→OVER (\n PARTITION BY y\n ORDER BY interval\n ROWS BETWEEN …\n ).Unexpected token: By→Expected an expression after BY.format_corpus.json: 49formattedupdated (48 queries; one is listed twice), old layout kept aspreviously_formatted; every new value equals SQLQuack 0.6.0's own corpus.sqlquack_departures.json: one tsql departure dropped (now matches), two updated. Two inline expectations in the layout-rule and VALUES tests. Full before/after list in the first comment.Verification
cargo test --release --workspace --locked,make check-ci,make test(72 pytest) pass.basics,everyday,everyday-models,duckdb-core,databricks-coreplus this repo'scrates/sqlclean/src/sql_lint/tests/fixtures/format_corpus.json. No fingerprint changes and no formatted/refused flips. 7 invalid Snowflake DDL statements now fail to parse;CREATE TABLE … CLUSTER BY … AS SELECTnow parses.