sqlfluff 4.2.2


pip install sqlfluff

  Latest version

Released: Jun 04, 2026


Meta
Author: Alan Cruickshank
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Operating System
  • Unix
  • POSIX
  • MacOS
  • Microsoft :: Windows

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: Implementation :: CPython
  • SQL

Topic
  • Utilities
  • Software Development :: Quality Assurance

SQLFluff

The SQL Linter for Humans

PyPi Version PyPi License PyPi Python Versions PyPi Status PyPi Downloads

GitHub Workflow Status ReadTheDocs Linting and formatting: Ruff Docker Pulls Gurubase

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):

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:

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

VS Code Extension

We also have a VS Code extension:

Getting Started

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

$ pip install sqlfluff
$ echo "  SELECT a  +  b FROM tbl;  " > test.sql
$ sqlfluff lint test.sql --dialect ansi
== [test.sql] FAIL
L:   1 | P:   1 | LT01 | Expected only single space before 'SELECT' keyword.
                       | Found '  '. [layout.spacing]
L:   1 | P:   1 | LT02 | First line should not be indented.
                       | [layout.indent]
L:   1 | P:   1 | LT13 | Files must not begin with newlines or whitespace.
                       | [layout.start_of_file]
L:   1 | P:  11 | LT01 | Expected only single space before binary operator '+'.
                       | Found '  '. [layout.spacing]
L:   1 | P:  14 | LT01 | Expected only single space before naked identifier.
                       | Found '  '. [layout.spacing]
L:   1 | P:  27 | LT01 | Unnecessary trailing whitespace at end of file.
                       | [layout.spacing]
L:   1 | P:  27 | LT12 | Files must end with a single trailing newline.
                       | [layout.end_of_file]
All Finished ๐Ÿ“œ ๐ŸŽ‰!

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

$ 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

Datacoves
The turnkey analytics stack, find out more at Datacoves.com.

4.2.2 Jun 04, 2026
4.2.1 May 14, 2026
4.2.0 May 13, 2026
4.1.0 Mar 26, 2026
4.0.4 Feb 09, 2026
4.0.4a1 Feb 08, 2026
4.0.3 Feb 08, 2026
4.0.1.post1 Feb 08, 2026
4.0.0 Jan 15, 2026
4.0.0a3 Jan 14, 2026
4.0.0a2 Nov 12, 2025
4.0.0a1 Oct 28, 2025
3.5.0 Oct 18, 2025
3.4.2 Jul 11, 2025
3.4.1 Jun 13, 2025
3.4.0 Apr 17, 2025
3.3.1 Feb 05, 2025
3.3.0 Dec 10, 2024
3.2.5 Oct 25, 2024
3.2.4 Oct 14, 2024
3.2.3 Oct 10, 2024
3.2.2 Oct 07, 2024
3.2.1 Oct 06, 2024
3.2.0 Sep 18, 2024
3.1.1 Aug 20, 2024
3.1.0 Jul 03, 2024
3.0.7 May 23, 2024
3.0.6 May 06, 2024
3.0.5 Apr 19, 2024
3.0.4 Apr 09, 2024
3.0.3 Mar 22, 2024
3.0.2 Mar 17, 2024
3.0.1 Mar 13, 2024
3.0.0 Mar 12, 2024
3.0.0a6 Mar 05, 2024
3.0.0a5 Jan 30, 2024
3.0.0a4 Dec 05, 2023
3.0.0a3 Nov 29, 2023
3.0.0a2 Nov 09, 2023
3.0.0a1 Nov 08, 2023
2.3.5 Oct 27, 2023
2.3.4 Oct 17, 2023
2.3.3 Oct 13, 2023
2.3.2 Sep 10, 2023
2.3.1 Aug 29, 2023
2.3.0 Aug 14, 2023
2.2.1 Aug 09, 2023
2.2.0 Aug 04, 2023
2.1.4 Jul 25, 2023
2.1.3 Jul 19, 2023
2.1.2 Jul 03, 2023
2.1.1 May 25, 2023
2.1.0 May 03, 2023
2.0.7 Apr 20, 2023
2.0.6 Apr 20, 2023
2.0.5 Apr 14, 2023
2.0.4 Apr 14, 2023
2.0.3 Apr 05, 2023
2.0.2 Mar 23, 2023
2.0.1 Mar 18, 2023
2.0.0 Mar 14, 2023
2.0.0a6 Mar 07, 2023
2.0.0a5 Feb 25, 2023
2.0.0a4 Jan 27, 2023
2.0.0a3 Jan 16, 2023
2.0.0a2 Jan 07, 2023
2.0.0a1 Dec 28, 2022
1.4.5 Dec 19, 2022
1.4.4 Dec 14, 2022
1.4.3 Dec 14, 2022
1.4.2 Nov 13, 2022
1.4.1 Oct 31, 2022
1.4.0 Oct 31, 2022
1.3.2 Sep 27, 2022
1.3.1 Sep 09, 2022
1.3.0 Aug 21, 2022
1.2.1 Jul 15, 2022
1.2.0 Jul 13, 2022
1.1.0 Jul 03, 2022
1.0.0 Jun 17, 2022
0.13.2 May 20, 2022
0.13.1 May 06, 2022
0.13.0 Apr 22, 2022
0.12.0 Apr 07, 2022
0.11.2 Mar 25, 2022
0.11.1 Mar 17, 2022
0.11.0 Mar 07, 2022
0.10.1 Feb 16, 2022
0.10.0 Feb 10, 2022
0.9.4 Jan 30, 2022
0.9.3 Jan 26, 2022
0.9.2 Jan 24, 2022
0.9.1 Jan 09, 2022
0.9.0 Dec 13, 2021
0.8.2 Nov 22, 2021
0.8.1 Nov 07, 2021
0.8.0 Nov 07, 2021
0.7.1 Oct 22, 2021
0.7.0 Oct 14, 2021
0.7.0a8 Oct 12, 2021
0.7.0a5 Oct 12, 2021
0.7.0a3 Oct 10, 2021
0.7.0a2 Oct 09, 2021
0.7.0a1 Oct 09, 2021
0.6.9 Oct 09, 2021
0.6.8 Oct 05, 2021
0.6.7 Oct 04, 2021
0.6.6 Sep 20, 2021
0.6.5 Sep 10, 2021
0.6.4 Aug 21, 2021
0.6.3 Aug 16, 2021
0.6.2 Jul 22, 2021
0.6.1 Jul 16, 2021
0.6.0 Jun 09, 2021
0.6.0a2 May 27, 2021
0.6.0a1 May 15, 2021
0.5.6 May 14, 2021
0.5.5 May 13, 2021
0.5.4 May 13, 2021
0.5.3 May 04, 2021
0.5.2 Apr 11, 2021
0.5.1 Apr 09, 2021
0.5.0 Apr 05, 2021
0.4.1 Mar 01, 2021
0.4.0 Feb 14, 2021
0.4.0a3 Dec 09, 2020
0.4.0a2 Dec 05, 2020
0.4.0a1 Nov 26, 2020
0.3.6 Sep 24, 2020
0.3.5 Aug 03, 2020
0.3.4 May 13, 2020
0.3.3 May 11, 2020
0.3.2.post2 May 09, 2020
0.3.2.post1 May 09, 2020
0.3.2 May 08, 2020
0.3.1 Feb 17, 2020
0.3.0 Feb 15, 2020
0.2.4 Dec 06, 2019
0.2.3 Dec 02, 2019
0.2.2 Dec 02, 2019
0.2.1 Dec 01, 2019
0.2.0 Dec 01, 2019
0.1.5 Nov 11, 2019
0.1.4 Nov 10, 2019
0.1.3 Oct 30, 2019
0.1.2 Oct 30, 2019
0.1.1 Oct 30, 2019
0.1.0 Oct 29, 2019
0.0.9 Oct 31, 2019
0.0.7 Nov 19, 2018
0.0.6 Nov 15, 2018
0.0.5 Nov 15, 2018
0.0.4 Nov 14, 2018
0.0.3 Nov 14, 2018
0.0.2 Nov 09, 2018
0.0.1 Nov 07, 2018

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
platformdirs
chardet
click (<8.4.0)
colorama (>=0.3)
diff-cover (>=2.5.0)
Jinja2
pathspec
pyyaml (>=5.1)
regex
tblib
tomli
tqdm