Skip to content
SPECIFICTION
Get listed

pgFormatter vs SQLFluff

pgFormatter

github.com

SQLFluff

sqlfluff.com

Side by side

FigurepgFormatterSQLFluff
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYes—
Windows—Yes
macOS—Yes
LinuxYesYes
APIYesYes
Self-hostedYesYes
Plans published11
Spec score · SQL Linters and Formatters8.2 (#6)8.0 (#10)
InstallationThe README documents installation from a GitHub source tarball using Perl Makefile.PL, make, and make install.The project’s website directs users to install SQLFluff from PyPI using pip or another Python package manager.
PurposepgFormatter beautifies PostgreSQL SQL queries and PL/pgSQL code, and supports keywords from several SQL standards as well as PostgreSQL-specific keywords.SQLFluff is an open source, dialect-flexible SQL linter designed with ELT applications in mind.

Plans

pgFormatter

  • pgFormatterFree

pgFormatter pricing →

SQLFluff

  • SQLFluffFree

SQLFluff pricing →

In their own words

pgFormatter

pgFormatter is free software for formatting PostgreSQL SQL queries and PL/pgSQL code. It supports SQL-92, SQL-99, SQL-2003, SQL-2008, SQL-2011 and PostgreSQL syntax, and the project says it also works with other databases. You can run it as a console program or CGI application that returns text or HTML; a CGI request with an application/json Accept header can return JSON. Formatting controls cover keyword, function, identifier and type case, indentation, query wrapping and comma placement. The --anonymize option hides query literals before formatting. The project documents source installation with Perl Makefile.PL, make and make install, Docker use, Vim and (Neo)Vim integration, Atom and Visual Studio Code links, and a pre-commit hook for SQL files. An online demo limits queries to ten thousand characters. It is distributed under the PostgreSQL Licence at free.

Visit github.com

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