Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sqlfluff

> 开发工具
Open source

A modular SQL linter and auto-formatter with support for multiple dialects and templated code.

9.8K stars0 likes0 views
WebsiteGitHub

About

A modular SQL linter and auto-formatter with support for multiple dialects and templated code.

The SQL Linter for Humans

SQLFluff is a dialect-flexible and configurable SQL linter. Designed with ELT applications in mind, SQLFluff also works with Jinja templating and dbt. SQLFluff will auto-fix most linting errors, allowing you to focus your time on what matters.

Table of Contents

  1. Dialects Supported
  2. Templates Supported
  3. VS Code Extension
  4. Getting Started
  5. Documentation
  6. Releases
  7. SQLFluff on Slack
  8. SQLFluff on Twitter
  9. Contributing
  10. Sponsors

Dialects Supported

Although SQL is reasonably consistent in its implementations, there are several different dialects available with variations of syntax and grammar. SQLFluff currently supports the following SQL dialects (though perhaps not in full):

  • ANSI SQL - this is the base version and on occasion may not strictly follow the ANSI/ISO SQL definition
  • Athena
  • BigQuery
  • ClickHouse
  • Databricks (note: this extends the sparksql dialect with Unity Catalog syntax).
  • Db2
  • Doris
  • DuckDB
  • Exasol
  • FlinkSQL
  • Greenplum
  • Hive
  • Impala
  • MariaDB
  • Materialize
  • MySQL
  • Oracle
  • PostgreSQL (aka Postgres)
  • Redshift
  • Snowflake
  • SOQL
  • SparkSQL
  • SQLite
  • StarRocks
  • Teradata
  • Transact-SQL (aka T-SQL)
  • Trino
  • Vertica

We aim to make it easy to expand on the support of these dialects and also add other, currently unsupported, dialects. Please raise issues (or upvote any existing issues) to let us know of demand for missing support.

Pull requests from those that know the missing syntax or dialects are especially welcomed and are the best way for you to get support added. We are happy to work with any potential contributors on this to help them add this support. Please raise an issue first for any large feature change to ensure it is a good fit for this project before spending time on this work.

Templates Supported

SQL itself does not lend itself well to modularity, so to introduce some flexibility and reusability it is often templated as discussed more in our modularity documentation.

SQLFluff supports the following templates:

  • Jinja (aka Jinja2)
  • SQL placeholders (e.g. SQLAlchemy parameters)
  • Python format strings
  • dbt (requires plugin)

Again, please raise issues if you wish to support more templating languages/syntaxes.

VS Code Extension

We also have a VS Code extension:

  • Github Repository
  • Extension in VS Code marketplace

Getting Started

To get started, install the package and run sqlfluff lint or sqlfluff fix.

…

If you want the optional Rust-backed parser and lexer, install the rs extra:

bash
$ pip install sqlfluff[rs]

On supported CPython 3.10+ platforms this installs a prebuilt ABI3 wheel. If no wheel is published for your platform, pip falls back to building sqlfluffrs from source, which requires a Rust toolchain and a working C/C++ build setup. The easiest way to install Rust is with rustup.

Alternatively, you can use the Official SQLFluff Docker Image or have a play using SQLFluff online.

For full CLI usage and rules reference, see the SQLFluff docs.

Documentation

For full documentation visit docs.sqlfluff.com. This documentation is generated from this repository so please raise issues or pull requests for any additions, corrections, or clarifications.

Releases

SQLFluff adheres to Semantic Versioning, so breaking changes should be restricted to major versions releases. Some elements (such as the python API) are in a less stable state and may see more significant changes more often. For details on breaking changes and how to migrate between versions, see our release notes. See the changelog for more details. If you would like to join in, please consider contributing.

New releases are made monthly. For more information, visit Releases.

SQLFluff on Slack

We have a fast-growing community on Slack, come and join us!

SQLFluff on Twitter

Follow us on Twitter @SQLFluff for announcements and other related posts.

Contributing

We are grateful to all our contributors. There is a lot to do in this project, and we are just getting started.

If you want to understand more about the architecture of SQLFluff, you can find more here.

If you would like to contribute, check out the open issues on GitHub. You can also see the guide to contributing, including the pull request acceptance principles and AI-assisted contribution expectations.

Sponsors


The turnkey analytics stack, find out more at [Datacoves.com](https://datacoves.com/).

Issues· 349 open

View all issuesOpen on GitHub
  • #8608

    BigQuery - Missing support for WITH Expressions

    enhancementbigqueryUpdated Sep 29, 2026
  • #8602

    Postgres: ON/OFF option values and PostgreSQL 16-17 EXPLAIN, VACUUM and ANALYZE options do not parse

    bugpostgresUpdated Sep 29, 2026
  • #8603

    LT05 does not count Jinja source which the template does not render

    bugUpdated Sep 29, 2026
  • #8600

    ClickHouse: Missing support for HYPOTHETICAL PROJECTIONS

    bugclickhouseUpdated Sep 28, 2026
  • #8597

    dbt templater fails with `DbtCatalogIntegrationNotFoundError` when using `catalogs.yml`

    bugUpdated Sep 28, 2026
  • #8594

    RF01: false positive when an alias/table reference differs in letter case from its declaration

    Updated Sep 28, 2026
  • #8589

    Parser does not validate data type argument arity (e.g. `DECIMAL(10, 2, 3)` is accepted)

    Updated Sep 26, 2026
  • #3599

    DELIMITER on MySQL is not understood as expected

    bugmysqlUpdated Sep 25, 2026
  • #8579

    Snowflake: ALTER CORTEX SEARCH SERVICE ... REFRESH is unparsable

    snowflakeUpdated Sep 25, 2026
  • #8564

    MySQL/MariaDB: support the `SOURCE` client command

    enhancementmysqlmariadbUpdated Sep 24, 2026

> Tags

Pythonhacktoberfestpypisqlsql-linter

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具