collate-sqlfluff
The SQL Linter for Humans
What it is and what it does
SQLFluff is a dialect-aware SQL linter designed to catch formatting, spacing, and style issues in SQL code. It supports a wide range of SQL dialects—including Snowflake, BigQuery, PostgreSQL, MySQL, Redshift, DuckDB, and many others—as well as Jinja templating and dbt projects. The tool can both report violations and automatically fix most of them, making it useful for enforcing consistent SQL style across teams and codebases.
You use it primarily as a command-line tool (via `sqlfluff lint` and `sqlfluff fix`) but can also integrate it into Python workflows through its API. It has 13 runtime dependencies including click for CLI, Jinja2 for template support, and pytest for testing. The package is actively maintained with monthly releases and works on Python 3.9 through 3.13.
Use it for:
- Enforce consistent SQL formatting and style across a team's dbt project or data pipeline.
- Automatically fix whitespace, indentation, and spacing issues in SQL files during CI/CD.
- Lint SQL code in multiple dialects without rewriting rules for each database system.
- Integrate SQL quality checks into a pre-commit hook or IDE workflow.
- Validate SQL templates that use Jinja variables before execution.
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 syntax errors across multiple SQL dialects, with support for Jinja templating and dbt.
Yes. SQLFluff is production-stable, actively maintained, permissively licensed under MIT, and has low install friction. It solves a real problem—enforcing SQL code quality across dialects—with broad dialect support and auto-fix capability. No known vulnerabilities. Install it if you need to lint or format SQL in your codebase or data pipeline.
Install
collate-sqlfluff on PyPI
pip
pip install collate-sqlfluffuv
uv add collate-sqlfluffpoetry
poetry add collate-sqlfluffInstalling collate-sqlfluff
Before you install
Low install friction with a pure-Python wheel and 13 common runtime dependencies. Active maintenance with releases monthly and a recent commit on 2026-05-28.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install collate-sqlfluff
from sqlfluff.core import Linter
linter = Linter(dialect='ansi')
result = linter.lint_string('SELECT a FROM tbl')
Requires Python 3.9 or later.
Verify before relying
- Whether the package's Python API is considered stable or subject to breaking changes between minor versions.
- Performance characteristics when linting large SQL files or many files in batch.
Package facts
| License | MIT License Copyright (c) 2023 Alan Cruickshank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — platformdirs, chardet, click, colorama, diff-cover, Jinja2, pathspec, pytest, pyyaml, regex, tblib, tomli, tqdm |
| Maintenance | actively maintained — 78 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 770,912/month — #5,103 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: collate_sqlfluff-3.5.3-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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
shandy-sqlfmtA command-line SQL formatter that automatically…
permissive · top 5,000 on PyPI
sqlfluffSQLFluff is a SQL linter and auto-fixer that…
permissive · top 5,000 on PyPI
sqlfluff-templater-dbtEnables SQLFluff to lint and auto-fix dbt…
permissive · top 5,000 on PyPI
sqlfluffrsSQLFluff-rs is a Rust-based optional component…
permissive · top 15,000 on PyPI
acryl-sqlglotParses, transpiles, and optimizes SQL across 23…
permissive · top 15,000 on PyPI
sqlglotSQLGlot parses, transpiles, optimizes, and…
permissive · top 1,000 on PyPI
sqlglotrsA SQL parser, transpiler, and optimizer that…
permissive · top 5,000 on PyPI
sqlglotcProvides mypyc-compiled C extensions that…
permissive · top 5,000 on PyPI
collate-sqllineageAnalyzes SQL statements to extract source and…
permissive · top 5,000 on PyPI
simple-ddl-parserParses SQL DDL statements and their dialect…
permissive · top 15,000 on PyPI