SQLFluff is an open source, 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.
SQLFluff finds issues with your SQL code and reports them back to you (and your team) automatically so that your code reviews can be more about function and less about form.
SQLFluff saves time by fixing linting issues found in your code to save you time, and make it easy to have consistent and legible SQL.
SQLFluff parses your SQL to catch a range of syntax issues without needing access to the database, so you can catch mistakes earlier in your development process.
SQLFluff is configurable to work with a range of SQL dialects and style choices. It has opinionated defaults, so you can get going easily, but a range of flexible configuration options to fit your local style.
$ 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 📜 🎉!
SQLFluff is a community run, and community funded, project. We're grateful to individuals and organisations in the community who choose to support the project. If you'd like to support the project with your time, then head over to our GitHub repository and check out our contributing guide. If you are better able to support the project with funds, then you can find our sponsorship page on GitHub sponsors.
The turnkey analytics stack, find out more at Datacoves.com.