Sqruff
Sqruff is a SQL linter and formatter written in Rust.
What Sqruff is
Sqruff is a SQL linter and formatter written in Rust. It checks SQL for issues and can apply configurable formatting and automated fixes, with dialect and rule choices stored in a project `.sqruff` file. Supported dialects include ANSI, Athena, BigQuery, ClickHouse, Databricks, DuckDB, MySQL, Oracle, Postgres, Snowflake, SQLite, and Trino, among others. The project also lists column-level data lineage analysis for SQL queries. Developers can use its VS Code or Zed integrations, or its LSP server with other LSP-capable editors. A GitHub Action is documented for running Sqruff in CI, and a browser playground lets users try it. Installation options include Homebrew, a bash installer, pip, cargo, binary releases, and an official Docker image. Sqruff is free and the public repository provides an Apache-2.0 license. Support for dbt projects is marked experimental. The project is associated with Quary, an open-source analytics platform for engineers based in the United Kingdom.
Good
- Configurable linting and automated formatting
- Supports many SQL dialects
- Integrations for VS Code and Zed
- GitHub Action documented for CI
- Free under an Apache-2.0 license
Watch out
- dbt project support is experimental
- Editor support outside VS Code and Zed uses its LSP server
Who it suits
Sqruff suits developers who want configurable SQL linting and formatting in an editor, browser playground, or CI workflow.
Verdict
Sqruff combines SQL checks, formatting, and fixes with multiple editor and CI options. Teams using dbt should note that this support is identified as experimental.
Plans and prices
From Sqruff's own pricing page, checked 29 Sep 2001.
| Plan | Price | What it gives you |
|---|---|---|
| Sqruff | Free | Open-source SQL linter and formatter |
The facts
Each one read from Sqruff's own pages, with the date it was checked.
Where it runs
- Browser playground
- The project provides a browser playground for trying Sqruff.checked 29 Sep 2001
What it does
- CI integration
- The installation guide documents a GitHub Action for installing and running Sqruff in CI.checked 29 Sep 2001
- Configuration
- Sqruff reads dialect and rule settings from a project `.sqruff` configuration file.checked 29 Sep 2001
- dbt support
- The overview labels dbt project support as experimental.checked 29 Sep 2001
- Editor integrations
- Sqruff maintains VS Code and Zed integrations and provides an LSP server for other LSP-capable editors.checked 29 Sep 2001
- Installation
- The guide lists Homebrew, a bash installer, pip, cargo, binary releases, and an official Docker image as installation options.checked 29 Sep 2001
- Lineage
- The overview lists column-level data lineage analysis for SQL queries as a feature.checked 29 Sep 2001
- Linting and formatting
- It offers customizable SQL linting and configurable automated formatting.checked 29 Sep 2001
- Open source license
- The GitHub repository identifies the project as public and provides an Apache-2.0 license.checked 29 Sep 2001
- Purpose
- Sqruff is a SQL linter and formatter written in Rust, focused on formatting valid SQL for specific dialects and providing fast linting and fixing.checked 29 Sep 2001
- SQL dialects
- Supported dialects include ANSI, Athena, BigQuery, ClickHouse, Databricks, DuckDB, MySQL, Oracle, Postgres, Snowflake, SQLite, Trino, and others.checked 29 Sep 2001
The company
- Headquarters
- United Kingdomchecked 23 Sep 2001
- Maker
- The GitHub organization describes Quary as an open-source analytics platform for engineers and lists the United Kingdom as its location.checked 29 Sep 2001
The full review of Sqruff
Overview
Sqruff is a free SQL linter and formatter for people who want dialect-aware checks and formatting in a development workflow. It suits SQL teams that value configurable rules, automatic fixes and editor or CI integration; dbt teams should be cautious because that support is experimental.
Written in Rust, Sqruff combines linting with configurable formatting and lists column-level data lineage analysis among its capabilities. The open-source project is licensed under Apache-2.0. Its breadth across SQL dialects is a strong fit for mixed-data environments, while its dbt support is not yet a safe basis for a workflow decision.
Key features
Linting, formatting and fixes
Sqruff supports customizable lint rules, automated formatting and automatic fixes. In practice, teams can align checks and formatting with project conventions rather than accept a fixed style. A project-level .sqruff file holds dialect and rule settings, giving a project a shared configuration point.
Dialect coverage
Supported dialects include ANSI, Athena, BigQuery, ClickHouse, Databricks, DB2, DuckDB, Exasol, Greenplum, Hive, MariaDB, Materialize, MySQL, Oracle, Postgres, Redshift, Snowflake, SparkSQL, SQLite, StarRocks, Teradata, Trino, T-SQL and Vertica. That range makes Sqruff a plausible choice when SQL projects span more than one database; teams should still confirm that their specific dialect and conventions fit their needs.
Editor and CI workflows
Sqruff maintains VS Code and Zed integrations and offers an LSP server for other LSP-capable editors. Its installation guide also documents a GitHub Action for running it in CI. These options let teams bring checks into editing and automated workflows, though the documented CI integration is specifically a GitHub Action.
Installation and browser access
Installation options include Homebrew, a bash installer, pip, cargo, binary releases and an official Docker image. A browser playground offers a way to try Sqruff without first adopting it in a project. The multiple installation routes suit varied setups, while the playground provides a lighter evaluation path.
Pricing
Sqruff is free: its Sqruff plan costs nothing and is described as an open-source SQL linter and formatter. The plan includes custom rules, automatic fixes, editor extensions, CI/CD integration and configuration-file support. There is no free trial because the product has a free plan; no paid tier or seat-based pricing is part of this offering. For individual users and teams alike, cost is not the trade-off—the key consideration is whether its dialect and workflow support match the project.
Platforms
Sqruff is available across extension, Linux, macOS, self-hosted, web and Windows platforms. Its editor integrations, installation choices and browser playground give it several routes into a development workflow, from local setup to trying it in a browser.
Who it's for
Sqruff is best suited to developers and data teams that want configurable SQL linting and formatting, automatic fixes, broad dialect coverage and integration with editors or GitHub CI. Its free, Apache-2.0-licensed model also makes it a sensible candidate for teams that want an open-source tool. It is a weaker fit for teams whose dbt workflow depends on mature, dependable project support, since dbt support is marked experimental.
Pros and cons
- Pros: Broad dialect support, including major warehouse and database dialects, makes it useful for varied SQL environments.
- Pros: Custom rules, automatic fixes and project configuration let teams adapt checks and formatting to their conventions.
- Pros: VS Code, Zed, LSP and GitHub Action support connect it to common editing and CI workflows.
- Pros: The free Apache-2.0 offering has no paid-plan barrier to adopting its listed features.
- Cons: dbt support is experimental, so teams relying on dbt should not treat Sqruff as a proven fit for that workflow.
Alternatives
For a broader comparison, see SQL Linters and Formatters.
- Poor SQL is a free alternative with online and offline formatting and an SSMS/Visual Studio plugin; its formatter library is open-source under AGPL.
- Sleek is another free SQL formatter, available for extensions and Linux, macOS and Windows.
- sqlfmt is worth considering if a browser-based formatter with no installation is the priority; its Browser formatter runs via WebAssembly.
- Squawk is a free alternative available across mobile, desktop, web, API and extension platforms.
- TSQLLint is a free option for T-SQL linting, distributed under MIT and installable with dotnet-tool, Homebrew or NPM.
- pgFormatter is a free alternative distributed under the PostgreSQL Licence and available for API, Linux, self-hosted and web use.
- Valk Guard is a free alternative for Windows, macOS and Linux.
- SQLCheck is a free alternative for Windows, macOS and Linux.
Verdict
Sqruff is a strong choice for SQL teams that want a free, configurable linter and formatter with broad dialect support and routes into editors and GitHub CI. Its chief reason to choose it is that it brings checks, formatting and automatic fixes together in an open-source tool. Look elsewhere if your workflow depends on established dbt support, since Sqruff labels that capability experimental.
Getting started
- Try Sqruff in its browser playground, or choose an installation route such as Homebrew, pip, cargo, binary releases, the bash installer, or Docker.
- Add a project `.sqruff` configuration file for dialect and rule settings.
- Use the VS Code or Zed integration, or connect another LSP-capable editor through the LSP server.
- Add the documented GitHub Action if you want to run Sqruff in CI.
Limits worth knowing
Sqruff is free. Its dbt project support is labeled experimental.
Questions
How much does Sqruff cost?
The listed Sqruff plan costs nothing.
Is Sqruff open source?
Yes. Its public GitHub repository provides an Apache-2.0 license.
Which SQL dialects does Sqruff support?
The listed dialects include ANSI, Athena, BigQuery, ClickHouse, Databricks, DB2, DuckDB, Exasol, Greenplum, Hive, MariaDB, Materialize, MySQL, Oracle, Postgres, Redshift, Snowflake, SparkSQL, SQLite, Starrocks, Teradata, Trino, TSQL, and Vertica.
Which editors can use Sqruff?
Sqruff maintains VS Code and Zed integrations and provides an LSP server for other LSP-capable editors.
Can I use Sqruff in CI?
Yes. The installation guide documents a GitHub Action for installing and running it in CI.
Does Sqruff support dbt projects?
The project labels dbt project support as experimental.
Alternatives to Sqruff
- 1
Poor SQL
Free planOpen sourceWebAPIExtensionLinux7.3Free plan - 2
SQLFormat.org
Free planOpen sourceWebAPIExtensionSelf-hosted7.1Free plan - 3
sqlfmt
Free planWebAPILinuxSelf-hosted6.7Free plan - 4
RegSQL
Free planWeb6.5From $8 a month - 5
SQLCheck
Free planLinuxmacOSWindows6.5Free plan - 6
sqlfmt
Free planWebAPI6.5From $9 a month
