sqlfmt vs TSQLLint
sqlfmt
github.comTSQLLint
github.comSide by side
| Figure | sqlfmt | TSQLLint |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | — | Yes |
| macOS | — | Yes |
| Linux | Yes | Yes |
| API | Yes | — |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · SQL Linters and Formatters | 8.5 (#3) | 7.4 (#19) |
| License | sqlfmt is distributed under the PostgreSQL Licence. | The software is distributed under the MIT License, which grants permission to use, copy, modify, distribute, sublicense, and sell copies subject to its conditions. |
| Purpose | sqlfmt is a gofmt-style command-line formatter for PostgreSQL SQL. | TSQLLint describes, identifies, and reports anti-patterns in TSQL scripts. |
Plans
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.
TSQLLint
TSQLLint checks T-SQL scripts for anti-patterns and reports the findings. Its command-line tool can correct issues it identifies as auto-fixable with the --fix or -x option. Rules can be set to off, warning, or error; an error-level violation produces a non-zero exit code. Users can save settings in a .tsqllintrc file, or use the tool’s in-memory defaults when no file is present. The listed SQL Server compatibility levels are 80, 90, 100, 110, 120, 130, 140, and 150. Custom .NET plugins can extend it if they implement TSQLLint’s IPlugin interface and target net6.0. Before linting, it substitutes SQL file placeholders with values from environment variables. Official installation methods include dotnet-tool, Homebrew, and NPM. Its VS Code extension marks potential problems in opened .sql files for inspection on hover, and SQL Server Management Studio can invoke it through External Tools. TSQLLint is free under the MIT License and runs on Linux, macOS, and Windows, with an editor extension also listed.