Vision for SQLfluff¶
SQLfluff has a few components:
A generic parser for SQL which aims to be able to unify SQL written in different dialects into a comparable format. The parser.
A mechanism for measuring written SQL against a set of rules, with the added ability to fix any violations found. The linter.
An opinionated set of guidelines for how SQL should be structured and formatted. The rules.
Most of the codebase for SQlfluff is the parser, mostly because at the point of developing SQLfluff, there didn’t appear to be a good option for a whitespace-aware parser that could be used instead.
With regards to the rules, SQLfluff aims to be opinionated but it also accepts that many organisations and groups have pre-existing strong conventions around how to write SQL and so ultimately SQLfluff should be flexible enough to support whichever rule set a user wishes to.