feat(fmt): use lax-sql for SQL formatting#35161
Merged
Merged
Conversation
bartlomieju
marked this pull request as ready for review
June 12, 2026 06:42
lax-sql 0.2.1 produces canonical output (author line breaks are no longer consulted) with the default fill clause style. Adds the required clause_style field to the config and regenerates the SQL fixtures: clauses sit on their own lines and bodies pack until the line width, so for example INSERT INTO and its column list stay on one line instead of being split across many.
bartlomieju
enabled auto-merge (squash)
June 13, 2026 11:52
bartlomieju
added a commit
that referenced
this pull request
Jun 14, 2026
Resolves conflicts after #35160 (lax-css) and #35161 (lax-sql) landed on main: - deps: keep lax-css + lax-markup + lax-sql; drop malva and markup_fmt - fmt.rs: format_html uses lax-markup; format_markup_embedded routes CSS to lax-css instead of the removed malva; format_embedded_html uses lax-markup - Cargo.lock reconciled (lax-markup 0.2.4 added, markup_fmt/malva removed) - bump lax-markup to 0.2.4 ({{ }} interpolation formatting) - regenerate vue fixture interpolations ({{a+b}} -> {{ a + b }})
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.
Replaces sqlformat with lax-sql (https://github.com/bartlomieju/lax) for
deno fmt --unstable-sqland for SQL embedded in tagged templates.lax-sql never interprets the SQL beyond splitting it into statements and
clauses, and it never rewrites a token. That makes it dialect agnostic by
construction: PostgreSQL dollar quoting and
E'...'strings, MySQLbackticks, T-SQL bracket identifiers and
#temptables, and everyplaceholder style (
?,$1,:name,@var) pass through untouched.Strings, quoted identifiers, numbers, and comments are never modified.
The output is canonical: each clause goes on its own line and the clause
body packs and wraps at the configured width, so the same query formats
the same way regardless of how it was typed. Keyword uppercasing is kept
to match the previous sqlformat output. Because the formatter is
canonical rather than preserving the input layout, SQL files reformat on
the first run; this is gated behind the unstable flag.
lax-sql is validated against the sqlfluff dialect fixture corpus, about
2150 files across 30 dialects, and carries regression tests for the
formatting bugs reported against sqlformat-rs, most of which cannot occur
here by construction. Statements that sqlformat mangled, such as
ON DELETE SET NULLconstraints or::casts, now keep their shape.