DEV.co
Open-Source Databases · quarylabs

sqruff

sqruff is a fast SQL linter and formatter written in Rust that supports multiple SQL dialects including PostgreSQL, BigQuery, Snowflake, and ClickHouse. It provides configurable linting rules, automated formatting, and easy integration into development workflows via CLI or browser playground.

Source: GitHub — github.com/quarylabs/sqruff
1.3k
GitHub stars
67
Forks
Rust
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryquarylabs/sqruff
Ownerquarylabs
Primary languageRust
LicenseApache-2.0 — OSI-approved
Stars1.3k
Forks67
Open issues65
Latest releasev0.39.0 (2026-07-03)
Last updated2026-07-08
Sourcehttps://github.com/quarylabs/sqruff

What sqruff is

Rust-based SQL parser and AST processor offering dialect-aware linting (65 open issues suggest active rule refinement), configurable formatting via .sqruff config files, and CLI tooling. Supports ANSI and vendor-specific SQL syntax across at least four major data warehouse dialects.

Quickstart

Get the sqruff source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/quarylabs/sqruff.gitcd sqruff# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Data warehouse SQL standardization

Enforce consistent SQL style and correctness across Snowflake, BigQuery, PostgreSQL, or ClickHouse codebases. Useful for teams managing large SQL repositories where dialect adherence matters.

CI/CD pipeline linting gate

Integrate sqruff into pre-commit hooks or build pipelines to catch SQL errors and style violations before code review. Fast Rust-based execution minimizes CI runtime overhead.

Developer productivity in data platforms

Use the browser playground or CLI for ad-hoc SQL formatting and validation during development, reducing manual style corrections and common mistake categories.

Implementation considerations

  • Install via brew (macOS), pip, cargo, or precompiled binary; verify installation method matches your deployment target OS and architecture.
  • Create `.sqruff` configuration at project root specifying dialect; rule defaults may differ by dialect, so validate on a sample codebase before full rollout.
  • Integrate into CI pipelines (e.g., GitHub Actions, GitLab CI) as a lightweight linting step; Rust binary is performant but ensure binary is cached to avoid repeated downloads.
  • Customize linting rules via config file; document rule set per team to avoid surprise violations in code review.
  • Plan for version upgrades; pre-1.0 releases may introduce breaking changes to CLI or config syntax. Test upgrade path in non-prod environment first.

When to avoid it — and what to weigh

  • Require guaranteed 100% dialect coverage — sqruff explicitly supports only listed dialects (PostgreSQL, BigQuery, Snowflake, ClickHouse, ANSI). If you use niche or proprietary SQL variants not listed, behavior is Unknown.
  • Need production-grade semantic validation — sqruff lints syntax and style; it does not perform semantic checks (e.g., column existence, type inference). For data quality guarantees, pair with a data cataloging or validation tool.
  • Depend on established enterprise support contract — Project is open-source with 65 open issues and community-driven. No SLA, commercial support tier, or guarantee of timely fixes for critical bugs is documented.
  • Require immutable, long-term rule stability — v0.39.0 signals pre-1.0 maturity; rule definitions, CLI flags, and config format may change between releases. Heavy customization may require ongoing maintenance burden.

License & commercial use

Apache License 2.0 (Apache-2.0), a permissive OSI-approved license. Allows commercial use, modification, and distribution under standard Apache terms (include license, state changes, provide NOTICE).

Apache-2.0 permits commercial deployment and integration without royalty. No commercial support tier, SLA, or proprietary restrictions are documented. Verify your legal team confirms this meets compliance obligations for your use case, especially if you modify the software or bundle it with proprietary code.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

sqruff is a linter that parses and analyzes user-provided SQL text; it does not execute SQL. Primary risk is denial-of-service (pathological SQL grammar causing parser hang). No public vulnerability disclosures found in the data provided. For sensitive environments, review code audit if available and monitor GitHub issues for security reports. Apache-2.0 license provides no liability indemnification.

Alternatives to consider

sqlfluff (Python-based)

Mature, language-agnostic SQL linter with broader dialect support and larger community. Slower than sqruff but established documentation and plugin ecosystem. Consider if Rust binary compatibility or performance is not a blocker.

Prettier (with SQL plugins)

General-purpose code formatter with growing SQL support. Lighter-weight for simple formatting workflows but less specialized linting. Better if your team standardizes on Prettier for multiple languages.

Vendor-provided linters (e.g., BigQuery Best Practices Guide, Snowflake documentation)

Free, platform-specific checks but manual enforcement and no CLI. Combine with sqruff for comprehensive coverage if vendor rules are not yet automated in sqruff.

Software development agency

Build on sqruff with DEV.co software developers

Evaluate sqruff in your CI/CD pipeline. Start with the browser playground, then integrate the CLI into your data platform for consistent, automated SQL linting.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

sqruff FAQ

Does sqruff execute SQL or just parse it?
sqruff only parses and analyzes SQL text; it does not execute queries. It is safe to run on untrusted SQL but cannot validate semantic correctness (e.g., table existence).
Can I use sqruff with dbt or other data tools?
sqruff is a standalone CLI tool; integration with dbt, Airflow, or similar frameworks requires wrapping the CLI in a script or custom invocation. No native dbt plugin is documented.
What happens if I upgrade sqruff and my rules break?
Pre-1.0 releases may have breaking changes to config syntax or rule IDs. Test upgrades in a non-prod branch first and review release notes for migration steps. Pin versions in CI if stability is critical.
Is sqruff suitable for production SQL validation in a data platform?
Yes, for linting and formatting gates in CI/CD. No, as a sole semantic validator; pair with data catalog, type checker, or query optimizer for full correctness guarantees.

Software developers & web developers for hire

Need help beyond evaluating sqruff? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.

Ready to standardize your SQL?

Evaluate sqruff in your CI/CD pipeline. Start with the browser playground, then integrate the CLI into your data platform for consistent, automated SQL linting.