Suggestions appear as you type. Use the up and down arrows to choose one and Enter to open it.

This page's audience our own tag's counts — open to see them
–Visits
–Page views
–Clicks to vendors
–Time on page
–Reading now
Clicks to vendors, by tool
  • –
Top countries
  • –
Devices
  • –

– · visits, page views and clicks counted by our own tag, which counts more than our checked analytics; every figure rounded down · how we count

sqlfmt review

Free#9 of 25 in SQL Linters and Formatters

A focused PostgreSQL formatter with diff workflows, editor integrations, and CI support.

7.8/10Editor score
sqlfmt7.8 Visit sqlfmt

Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026

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.

sqlfmt pros and cons

  • 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

sqlfmt fact sheet, pricing and score →

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