5 Command line tool to validate (syntax check) SQL files.
6 Primarily for MySQL ``.sql`` files.
8 Can be used in git pre-commit hooks to catch errors.
16 $ ./bin/php-sqllint tests/files/create-missingcomma.sql
17 Checking SQL syntax of tests/files/create-missingcomma.sql
18 Line 3, col 5 at "pid": A comma or a closing bracket was expected.
19 Line 3, col 13 at "11": Unexpected beginning of statement.
20 Line 3, col 17 at "DEFAULT": Unrecognized statement type.
24 $ ./bin/php-sqllint -r emacs tests/files/create-noname.sql
25 tests/files/create-noname.sql:1.12:Error: The name of the entity was expected.
26 tests/files/create-noname.sql:1.13:Error: A closing bracket was expected.
27 tests/files/create-noname.sql:1.13:Error: At least one column definition was expected.
33 - PEAR's `Console_Commandline`__
34 - `udan11's SqlParser`__, which is used by `phpMyAdmin`__
36 __ http://pear.php.net/package/Console_CommandLine
37 __ https://github.com/udan11/sql-parser
38 __ https://www.phpmyadmin.net/
49 ``php-sqllint`` is licensed under the `AGPL v3`__ or later.
51 __ http://www.gnu.org/licenses/agpl.html
57 http://git.cweiske.de/php-sqllint.git
59 Mirror: https://github.com/cweiske/php-sqllint
64 Written by Christian Weiske, cweiske@cweiske.de