Skip to content

feat: format BigQuery, PostgreSQL and T-SQL with SQLQuack - #42

Merged
kvlonge merged 1 commit into
mainfrom
feat/tsql-bigquery-postgres-format
Nov 8, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/tsql-bigquery-postgres-format

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

SQLQuack main 33e43849 formats BigQuery and PostgreSQL, and its SQL Server parser reads procedures and reports where each statement was written. SQLClean 0.5.0 formats only DuckDB and Snowflake.

Changes

  • Pin SQLQuack at main 33e43849 and add sqlquack-syntax-sqlserver.
  • Format bigquery, postgres/postgresql and tsql/mssql/sqlserver. Corpus tests expect SQLQuack's counts, with its departures copied.
  • format splits T-SQL at the statements SQL Server's parser reads, so a batch without semicolons comes out one statement apart.
  • Facts probe dialect support with SELECT 1: the Databricks parser refuses empty SQL, which made every Databricks file fail format.
  • The corpus helper skips the fingerprint check for text left as written.
  • The configuration page says which dialects each command reads.

Verification

  • make check-ci passes (fensu 0 faults, clippy -D warnings).
  • cargo test --all: 40 passed, 1 ignored, plus 8. Corpus formatted/refused: Snowflake 426/9, DuckDB 189/0, BigQuery 161/7, PostgreSQL 124/13, T-SQL 52/23.
  • pytest: 72 passed, with new end-to-end cases for T-SQL batches, procedures, aliases, BigQuery, PostgreSQL and Databricks.
  • No polyglot in cargo tree or Cargo.lock.

Pin SQLQuack at main 33e43849, whose SQL Server parser reports where each
statement was written and reads procedures, and whose formatter lays out
BigQuery and PostgreSQL.

- bigquery, postgres and postgresql files are formatted; their corpora match
  SQLQuack's, with its departures copied.
- tsql, mssql and sqlserver files are formatted; format splits a T-SQL file at
  the statements SQL Server's parser reads, so a batch written without
  semicolons comes out one statement apart.
- Facts ask whether a dialect parses with SELECT 1, not empty SQL, which the
  Databricks parser refuses; Databricks files were failing format.
- The configuration page says which dialects each command reads.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sqlclean with  Cloudflare Pages  Cloudflare Pages

Latest commit: 54e5c96
Status: ✅  Deploy successful!
Preview URL: https://ad82ecb7.sqlclean.pages.dev
Branch Preview URL: https://feat-tsql-bigquery-postgres.sqlclean.pages.dev

View logs

@kvlonge
kvlonge merged commit a813f5f into main Nov 8, 2026
16 of 18 checks passed
@kvlonge
kvlonge deleted the feat/tsql-bigquery-postgres-format branch November 8, 2026 17:13
This was referenced Nov 8, 2026
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