Skip to content
SPECIFICTION
Get listed

sqlfmt vs Sqruff

sqlfmt

github.com

Sqruff

github.com

Side by side

FiguresqlfmtSqruff
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYesYes
Windows—Yes
macOS—Yes
LinuxYesYes
APIYes—
Self-hostedYesYes
Plans published11
Spec score · SQL Linters and Formatters8.5 (#3)7.5 (#17)
Editor integrationsThe repository provides an Emacs sqlfmt-mode and a Vim ftplugin using formatprg and equalprg.Sqruff maintains VS Code and Zed integrations and provides an LSP server for other LSP-capable editors.
Purposesqlfmt is a gofmt-style command-line formatter for PostgreSQL SQL.Sqruff is a SQL linter and formatter written in Rust, focused on formatting valid SQL for specific dialects and providing fast linting and fixing.

Plans

sqlfmt

  • Browser formatterFree

sqlfmt pricing →

Sqruff

  • SqruffFree

Sqruff pricing →

In their own words

sqlfmt

sqlfmt is a free formatter for PostgreSQL SQL, available as a command-line tool and as a browser formatter running through WebAssembly. Its river-aligned style pads clause keywords so they share a column. The CLI reads SQL from files or stdin and writes formatted SQL to stdout; it can also rewrite files in place, list files needing changes, and show unified diffs. Its explain subcommand formats PostgreSQL plan text and can provide advice, canonicalized output, or structural comparisons. Plan advice describes join order, join and access methods, and parallelism, without costs, row estimates, or timing. The explain diff operation returns exit code 0 for structurally identical plans and 1 when structures differ, so it can be used in scripts and CI. A Go subpackage provides formatting for Go programs, and the project includes Emacs and Vim integrations. The browser build exposes formatting and version functions to JavaScript. Deeply nested subqueries and less common upsert or DDL forms remain best-effort areas. sqlfmt is intended for standalone formatting and SQL used in The Art of PostgreSQL book and courses.

Visit github.com

Sqruff

Sqruff is a free SQL linter and formatter written in Rust, focused on formatting valid SQL for particular dialects and providing linting and fixes. It offers configurable automated formatting, custom rules, and column-level data lineage analysis for SQL queries. Dialects include ANSI, Athena, BigQuery, ClickHouse, Databricks, DuckDB, MySQL, Oracle, Postgres, Snowflake, SQLite, and Trino, among others. Dialect and rule settings are read from a project `.sqruff` configuration file. Developers can use the maintained VS Code and Zed integrations, or an LSP server with other LSP-capable editors. A documented GitHub Action supports use in CI, and a browser playground is available. Installation options include Homebrew, a bash installer, pip, cargo, binary releases, and an official Docker image. The public repository provides an Apache-2.0 license. The project identifies dbt project support as experimental and is associated with Quary, an open-source analytics platform for engineers based in the United Kingdom.

Visit github.com