Skip to content
SPECIFICTION
Get listed

SQLFluff vs sqlfmt

SQLFluff

sqlfluff.com

sqlfmt

github.com

Side by side

FigureSQLFluffsqlfmt
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Web—Yes
WindowsYes—
macOSYes—
LinuxYesYes
APIYesYes
Self-hostedYesYes
Plans published11
Spec score · SQL Linters and Formatters8.0 (#10)8.5 (#3)
PurposeSQLFluff is an open source, dialect-flexible SQL linter designed with ELT applications in mind.sqlfmt is a gofmt-style command-line formatter for PostgreSQL SQL.

Plans

SQLFluff

  • SQLFluffFree

SQLFluff pricing →

sqlfmt

  • Browser formatterFree

sqlfmt pricing →

In their own words

SQLFluff

SQLFluff is an open-source, dialect-flexible SQL linter designed for ELT applications. It reports style and syntax issues, parses SQL without database access and can automatically fix many violations with one command. Documentation describes support for more than 25 dialects, including T-SQL, PostgreSQL, BigQuery and Snowflake, alongside more than 70 rules for style, structure and best practices. Jinja templating and dbt are supported, and CI/CD integration includes GitHub Actions output for pull-request annotations. SQLFluff is free under the MIT License and installs from PyPI with pip or another Python package manager. It does not execute SQL itself, but templating macros such as dbt's run_query may execute arbitrary SQL. The Jinja templater uses Jinja2 SandboxedEnvironment to limit unsafe code execution. The dbt templater requires the relevant adapter and sqlfluff-templater-dbt package; models accessing a database during compilation require database access. Community support includes documentation, GitHub, Slack and Stack Overflow.

Visit sqlfluff.com

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