sqlfmt
sqlfmt: A focused PostgreSQL formatter with diff workflows, editor integrations, and CI support. Ranked #9 of 25 in SQL Linters and Formatters by our editors (7.8/10); pricing: Free plan; best for postgreSQL teams using diff-based formatting.
At a glance
- Editor score7.8 / 10
- PricingFree plan
- Best forPostgreSQL teams using diff-based formatting
- Free planYes
- Paid fromFree
- Supported SQL dialectsPostgreSQL
- Automatic fixesYes
- Facts checked20 Sep 2026

Where it wins
- Formats PostgreSQL SQL and rewrites files in place
- Produces unified diffs and lists files needing formatting
- Works with Emacs, Vim, WebAssembly, and GitHub Actions
Where it doesn't
- Supports PostgreSQL rather than multiple SQL dialects
- Command-line workflow may not suit teams wanting a broader GUI tool
- Formatting follows river-aligned rules rather than configurable styles
Our verdict on sqlfmt
sqlfmt is an open-source, gofmt-style command-line formatter for PostgreSQL SQL. It is aimed at developers and teams that want consistent formatting across local workflows, editors, scripts, and CI pipelines. The tool can print formatted SQL, rewrite files in place with the -w option, identify files whose formatting would change, and read from standard input while writing to standard output. It also formats EXPLAIN statements and parses EXPLAIN plan output, extending its focus beyond ordinary query text.
Its strongest fit is a diff-based review workflow. sqlfmt can produce unified diffs for formatted SQL, making proposed changes visible before files are rewritten. Teams can use GitHub Actions for CI testing, while Emacs and Vim integrations bring formatting into established editor workflows. A WebAssembly build supports browser use, and the included Go formatting library provides a programming interface for Go-based tooling. Together, these options cover command-line, editor, CI, browser, and library-based use without changing the product’s PostgreSQL focus.
The main trade-off is breadth. sqlfmt formats PostgreSQL SQL, so teams working across several SQL dialects should look for a formatter with wider dialect coverage. Its river-aligned formatting rules also present a defined style rather than a broad set of style choices. Choose sqlfmt when PostgreSQL consistency, in-place rewriting, unified diffs, and lightweight workflow integration matter most. Choose an alternative when a multi-dialect formatter or a more configurable presentation layer is the priority.
Your product? Our editors can test sqlfmt in depth and publish a review, labelled as paid · from $149/mo →
sqlfmt pricing
sqlfmt fact sheet
| Free plan | Yes |
|---|---|
| Paid from | Free |
| Supported SQL dialects | PostgreSQL |
| Automatic fixes | Yes |
| Custom rules | Not verified |
| Editor extensions | Yes |
| CI/CD integration | Yes |
| Configuration file | Not verified |
| Deployment | Self-hosted, Browser extension |
| Platforms | Web, Linux |
| Support | Docs, Community |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 4 integrations: Emacs, Vim, GitHub Actions, WebAssembly |
| Pricing | Free plan |
| Website | github.com |
| Facts checked | 20 Sep 2026 |
sqlfmt integrations
sqlfmt lists 4 integrations on its own site.
- Emacs
- Vim
- GitHub Actions
- WebAssembly
Alternatives to sqlfmt
- SQLFluffConfigurable SQL linting with autofix, templating, plugins, and CI workflows.9.4
- SqruffA focused open-source choice for dbt teams needing linting, formatting, and CI workflows.9.1
- pgFormatterA configurable, open-source formatter for PostgreSQL-focused SQL workflows.8.8
Used sqlfmt? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used sqlfmt for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
sqlfmt is listed in our SQL Linters and Formatters directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/sqlfmt/"><img src="https://www.itechguides.com/best/badge/sqlfmt.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update
