Skip to content
SPECIFICTION
Get listed

pgFormatter vs Sqruff

pgFormatter

github.com

Sqruff

github.com

Side by side

FigurepgFormatterSqruff
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.2 (#6)7.5 (#17)
Editor integrationsThe README describes use with Vim and (Neo)Vim and links to Atom and Visual Studio Code integrations.Sqruff maintains VS Code and Zed integrations and provides an LSP server for other LSP-capable editors.
InstallationThe README documents installation from a GitHub source tarball using Perl Makefile.PL, make, and make install.The guide lists Homebrew, a bash installer, pip, cargo, binary releases, and an official Docker image as installation options.
PurposepgFormatter beautifies PostgreSQL SQL queries and PL/pgSQL code, and supports keywords from several SQL standards as well as PostgreSQL-specific keywords.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

pgFormatter

  • pgFormatterFree

pgFormatter pricing →

Sqruff

  • SqruffFree

Sqruff 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

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