Conversation
This was referenced Sep 16, 2026
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.
What
clauseBodyStyle"break""break","compact"isolateSemicolonfalseclauseBodyStyle=compactKeeps the first element of a clause body on the keyword line instead of starting a new one.
Applies to
WHERE/HAVING/ONconditions and toFROM/WINDOWbodies:isolateSemicolon=truePuts the terminating semicolon on its own line, but only when the statement already spans several lines - a one-line statement keeps its
;attached:Why
compactis the shape most hand-written SQL in data pipelines already uses, and it saves a line per clause on wide screens.The isolated semicolon is what makes a multi-statement migration file diff cleanly: adding a statement at the end no longer rewrites the previous statement's last line.
Implementation
clauseBodyStyleis resolved inrenderer.rswhen a clause group is opened, and inselect_stmt.rs/nodes/mod.rsfor the clauses that emit their own break.isolateSemicolonis a renderer decision taken once the statement is known to be multi-line.Wiring:
pgls_configuration(--clause-body-style,--isolate-semicolon),pgls_workspacesettings,docs/features/formatting.md,docs/schema.json.Tests
Three new fixtures (
compact_clause_condition,compact_from_clause,isolated_semicolon) with snapshots.Defaults leave every existing snapshot untouched.
The two preparatory commits
The first two commits of this PR are shared, byte for byte, with the three other formatter-option PRs open alongside it:
commaStyle/logicalOperatorPlacementlayoutcastStyleThe shared commits are:
test(pretty-print): allow per-fixture format configurationrefactor(pretty-print): thread the format config into the emitterThey are carried in each PR so every option remains independently reviewable and mergeable.
Whichever PR lands first, I will rebase the other three to remove the duplicate commits.
Merge them in whatever order suits you; nothing here depends on the others.