skillfed

sqlfluff

The SQL Linter for Humans

sqlfluff v4.3.0 11.5M downloads/30d#1,387 on PyPI9,853
Permissive license MIT License Copyright (c) 2018-2026 Alan Cruickshank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) Active released

What it is and what it does

SQLFluff is a dialect-flexible SQL linter designed to catch formatting, spacing, and style violations in SQL code. It works as a command-line tool that analyzes SQL files, reports issues with line and position information, and can automatically fix most violations. The tool is built to handle real-world SQL workflows, including templated SQL with Jinja and dbt projects.

It supports a wide range of SQL dialects—from ANSI SQL to vendor-specific variants like BigQuery, Snowflake, PostgreSQL, MySQL, and many others—making it useful across different database platforms and cloud data warehouses. The linter can be configured per project and integrates into development workflows via CLI, VS Code extension, or Docker, allowing teams to enforce consistent SQL style without manual review.

Use it for:

  • Enforce consistent SQL formatting and style across a team's data pipeline or dbt project
  • Automatically fix common SQL formatting issues like spacing and indentation in bulk
  • Lint SQL code in CI/CD pipelines to catch style violations before deployment
  • Validate SQL syntax and style for a specific database dialect (e.g., BigQuery, Snowflake)
  • Integrate SQL quality checks into VS Code or other editors during development
  • Standardize templated SQL with Jinja and dbt formatting in ELT applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SQLFluff is a SQL linter and auto-fixer that checks SQL code for style and formatting issues across multiple SQL dialects, with support for Jinja templating and dbt.

Yes. SQLFluff is actively maintained, has no known vulnerabilities, installs with low friction, and carries a permissive MIT License. It fills a clear need for SQL code quality in modern data workflows. Install it if you work with SQL across multiple dialects, use dbt, or want to enforce team SQL style standards.

Install

sqlfluff on PyPI

pip

pip install sqlfluff

uv

uv add sqlfluff

poetry

poetry add sqlfluff

Installing sqlfluff

Before you install

Low friction install with 12 lightweight runtime dependencies. Active maintenance with releases monthly; last release 7 days ago. Repository shows strong community engagement with 9853 stars.

License in practice

MIT License (permissive) allows commercial and private use with minimal restrictions; you must include the license notice and copyright statement.

Quickstart

pip install sqlfluff
echo "SELECT a FROM tbl;" > test.sql
sqlfluff lint test.sql --dialect ansi
sqlfluff fix test.sql --dialect ansi

Requires Python 3.10 or later. Optional Rust-backed parser available via extra install.

Verify before relying

  • Completeness of dialect support coverage (documentation notes 'perhaps not in full')
  • Performance characteristics on large SQL files or projects
  • Integration maturity with dbt workflows beyond basic support
  • Build requirements for optional Rust-backed parser on unsupported platforms

Package facts

License MIT License Copyright (c) 2018-2026 Alan Cruickshank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 12 — platformdirs, chardet, click, colorama, diff-cover, Jinja2, pathspec, pyyaml, regex, tblib, tomli, tqdm
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 11,521,310/month — #1,387 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlfluff-4.3.0-py3-none-any.whl

Keywords: sqlfluff, sql, linter, formatter, athena, bigquery, clickhouse, databricks, db2, doris, duckdb, exasol, flink, greenplum, hive, impala, materialize, mariadb, mysql, postgres, redshift, snowflake, soql, sparksql, sqlite, starrocks, teradata, trino, tsql, vertica, dbt

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: SQLTopic :: Software Development :: Quality AssuranceTopic :: Utilities

Tags

sql linter formattersql code quality checkersql style guide enforcementsql dialect supportdbt sql lintingjinja sql templatingsql auto-fixsql formatting tool
sql-lintingdata-pipelinedbt-integration

More Utilities packages