SQL Formatter vs SQLFluff
SQL Formatter
sql-formatter-org.github.ioSQLFluff
sqlfluff.comSide by side
| Figure | SQL Formatter | SQLFluff |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | — | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 1 |
| Spec score · SQL Linters and Formatters | 7.7 (#13) | 8.0 (#10) |
| Purpose | SQL Formatter is a JavaScript library for pretty-printing SQL queries. | SQLFluff is an open source, dialect-flexible SQL linter designed with ELT applications in mind. |
| Templating | Templating syntax is not directly supported; the README describes a parameter-type workaround that may not cover every templating construct. | SQLFluff supports Jinja templating and dbt. |
Plans
In their own words
SQL Formatter
SQL Formatter is a free, MIT-licensed JavaScript library for pretty-printing SQL queries, with a browser demo and command-line tool. Formatting options include indentation; keyword, data type, function, and identifier case; logical operator placement; expression width; query spacing; and operator spacing. It supports dialects including BigQuery, ClickHouse, DB2, DuckDB, Hive, MariaDB, MySQL, TiDB, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Redshift, SingleStoreDB, Snowflake, Spark, SQL Server Transact-SQL, and Trino/Presto. The command-line tool accepts SQL from standard input or a file, can produce formatted output, and can update a file in place. The project also lists VS Code and Vim extensions, a Prettier plugin, and an ESLint integration. Its JSON Schema supports configuration-file autocompletion and IntelliSense, with usage guides for VS Code and Zed. The library can replace prepared-statement placeholders when parameter values are supplied. It does not support stored procedures or changing the delimiter from a semicolon. Templating syntax is not directly supported; a parameter-type workaround may not cover every construct. The maintainer describes the project as being in maintenance mode, with feasible bug fixes and likely no new features.
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.