Releases: joereynolds/sql-lint
v1.0.0
We're finally moving out of major version zero now that we consider sql-lint
stable.
Only one small thing has been added into this release but it was the right time to bump the version.
Changes
ignore-errors
is now a cli option- Previously this was only a valid value in
config.json
but it makes sense to be able to pass it via the command line too. You can read about this flag in the docs but here's an example of usage:sql-lint --ignore-errors=trailing-whitespace some-sql-file.sql
- Previously this was only a valid value in
Enjoy!
And thanks for being super patient while I neglect and then spend time on this project sporadically <3
v0.0.20
A few small bug fixes in this release
SEQUENCE
is now a valid option for postgres'ALTER
statementsignore-errors
inconfig.json
is now respected. The implementation was there previously but ignored for some reasonsql-lint
no longer hangs on unresolved promises when used programmatically
Generate .d.ts declaration files for programmatic access
v0.0.19 Set version to 0.0.19
v0.0.18
Adds programmatic access to sql-lint so you can lint your SQL within JS/TS.
v0.0.17
- Adds support for Mysql 8
v0.0.16
- Adds a test to check for trailing whitespace
- sql-lint no longer aborts on error if piped via stdin (this is useful when used in a text editor, it won't bail out on an invalid file anymore, or it will at least try to continue)
SCHEMA
is now a valid create optionTYPE
is a valid create option for PostgresROLE
is now a valid option- Much improved driver support
- The checks are now driver independent so we can get finer grained control between the checks per driver (Mysql/Postgres etc...)
- Scaffolding is also in place to allow for new drivers to be added since this is a major bottleneck
v0.0.15
Some minor updates in this one:
- Bump up some dependencies
- Add a
-c
/--config
option. You can specify a path to a config file if you do not want it to look in~/.config/sql-lint/config.json
- Removd the
postinstall
command from package.json in the hopes it will fix some issues on Windows
v0.0.14
This version sees many updated and improvements made so let's dig in:
- sql-lint now recurses over directories. A simple
sql-lint .
will
lint all.sql
files in your current directory
NOTE: this will not work in the packaged executable. The pacakged executable
is a snapshotted filesystem. Use the version from npm if you want this behaviour. - The --file and -f flag has been removed. Now you can specify it right
away without a flag i.e. `sql-lint my-file.sql - The --query and -q flag has been removed. These were unneccessary and
if you want to lint a fixed string, you can do so via the stdin i.e.
`echo | 'DELETE FROM person;' | sql-lint - A new check for hungarian notation has been created. This will warn of
anysp_
ortbl_
prefixes - Linting errors now carry extra information about them. If you want to
see this information, pass the-v
flag through on the command line ALTER COLUMN
statements now work for postgres users- The wording around a missing config file has been updated to give you
better guidance - The warning about missing a config file will only show if
-v
is set - sql-lint will correctly fail if a file is not found that was specified
- An extremely basic sql formatter is in place. Do not expect much
you can experiment with it using the--fix
flag
There are many other changes that can be glanced at through the commit
history but those are the main ones. As you can see, a lot of work has
been put in to make the CLI easier and more intuitive to use.
v0.0.13
Small bugfix which fixes the path to checks
v0.0.12
-
New check for unmatched parentheses in queries
- If there is an unbalanced amount of parentheses, sql-lint will
highlight this to you to make changes
- If there is an unbalanced amount of parentheses, sql-lint will
-
Simple checks can be ran without a configuration file
- Whereas before, a configuration file was mandatory even if it was
not used, we now do not require one at all unless you want more
intelligent errors to come through
- Whereas before, a configuration file was mandatory even if it was
-
Fix the keyword 'OR' breaking the InvalidCreateOption check
-
Port number is now configurable
- You can specify
port
in your.config.json
configuration file or
you can pass the--port
on the command line to use a non-standard
port. Note that it defaults to 3306 if none are supplied
- You can specify
-
Limited (heh) support for LIMIT has been added
- The LIMIT clause is now recognised in SELECT statements as well as
the row count
- The LIMIT clause is now recognised in SELECT statements as well as
-
New check for invalid row counts on LIMIT clauses
-
If you specify a non-integer argument to LIMIT,
sql-lint
will
highlight this to you to make changes -
sql-lint
no longer dies onDELIMITER
orEND
keywords -
Exit with an exit code of 1 if any errors occur
- This allows us to integrate it into build scripts etc...
-
Better documentation
sql-lint
s docs have moved over to readthedocs
sql-lint.readthedocs.io
The format is better and they are easily searchable. An offline
solution such as a man/info page will be coming in the future