SQRUFF is an innovative SQL linter and formatter for modern development environments, written in Rust. Key features include:
Dialects SupportedSqruff currently supports the following SQL dialects:
While those above are the supported dialects, we are working on adding support for more dialects in the future. Getting StartedTry it out in your browserOpen our Quary template template, install the recommended sqruff extension, change the file and see the fixes on save. InstallationmacOSYou can use brew to install sqruff easily on macOS.
LinuxUsing
For other platformsEither download the binary from the releases page or compile it yourself and with cargo with the following commands.
Visual Studio Code ExtensionIn addition to the CLI installation mechanism listed above, sqruff is also released as a Visual Studio Code extension. UsageLintingTo lint a SQL file or set of files, run the following command:
FixingTo fix a single or set of files, run the following command:
HelpTo get help on the available commands and options, run the following command:
For all the details on the CLI commands and options, see the CLI documentation. ConfigurationFor all the details on the rules options, see the configuration documentation. CommunityJoin the Quary community on Slack to ask questions, suggest features, or share your projects. Also feel free to raise any issues in the repository. ContributingContributions are welcome! See CONTRIBUTING.md for guidelines on how to run things locally and on how to contribute. CreditsThe sqruff project wouldn't be possible without "heavy inspiration" from Sqlfluff! We're very grateful to their awesome work! |