Sqruff lints and formats SQL written in Rust, with dialect-aware rules and optional column-level lineage. Use it from the CLI, editors, or a browser playground.
Overview
Sqruff is a SQL linter and formatter built in Rust. It targets valid SQL for specific dialects such as ANSI SQL, BigQuery, ClickHouse, and Snowflake, and emphasizes fast linting and fixing without trying to repair partially correct SQL.
Configurable lint rules and automated formatting help keep SQL consistent in projects and CI workflows. Experimental features mentioned in the documentation include dbt project support and SQL column lineage analysis. An LSP server ships with the tool, with maintained editor integrations for VS Code and Zed.
Sqruff started as an exact replacement for SQLFluff but is diverging, with accurate per-dialect definitions and a configuration format that may change over time. Installation options include package managers, Cargo, binary downloads, and pip, with a documented quickstart for linting and configuring projects via a .sqruff file.
A browser playground lets you try the formatter and linter without a local install. Documentation covers installation, usage, configuration, rules, and CLI reference on the project docs site.
Key features
- Configurable SQL lint rules
- Automated SQL formatting
- Dialect-specific SQL validation
- Column-level SQL lineage
- LSP server for editors
- Browser playground
- dbt project support (experimental)
- CI workflow integration
Use cases
- Enforce SQL style in repositories
- Format SQL in CI pipelines
- Lint SQL in VS Code or Zed
- Analyze query column lineage
- Try formatting in the browser