Skip to content

purcell/sqlint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d8696f3 · Apr 4, 2025
Apr 4, 2025
Oct 6, 2015
Nov 11, 2023
Mar 18, 2021
Jul 15, 2015
Dec 29, 2018
Jul 15, 2015
Nov 11, 2023
Oct 29, 2024
Apr 4, 2025
Jul 16, 2015
Nov 25, 2017
Nov 7, 2024
Jul 16, 2015
Jul 17, 2015
Apr 4, 2025
Oct 29, 2024
Apr 4, 2025
Oct 29, 2024

Repository files navigation

Build Status Support me

SQLint - a simple SQL linter

About

SQLint is a simple command-line linter which reads your SQL files and reports any syntax errors or warnings it finds.

At this stage, SQLint checks SQL against the ANSI syntax, and uses the PostgreSQL SQL parser to achieve this. SQLint does not have support for non-standard SQL variants (e.g. MySQL), but contributions are welcome.

Installation

SQLint is currently provided as a ruby gem: you can install it using the following command:

gem install sqlint

Usage

To check the syntax of a file containing SQL, simply pass the filename to sqlint on the command line:

sqlint filename.sql

In the absence of a filename, sqlint reads from standard input.

Editor plugins

Support for sqlint is provided for the following editors:

Using with pre-commit

Add this to your .pre-commit-hooks.yaml:

-   repo: https://github.com/purcell/sqlint
    rev: master
    hooks:
    -   id: sqlint

Authors

This software was written by Steve Purcell and Kieran Trezona-le Comte.

License and copyright

Copyright 2015-2018 Powershop NZ Ltd. Copyright 2018-2021 Steve Purcell. MIT license.


💝 Support this project and my other Open Source work via Patreon

💼 LinkedIn profile

✍ sanityinc.com

About

Simple SQL linter supporting ANSI and PostgreSQL syntaxes

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published