Skip to content

A thin wrapper around the SqlParser from the phpMyAdmin project which can be used to lint any amount of sql files from the command line.

License

Notifications You must be signed in to change notification settings

Liquipedia/SqlLint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SqlLint

Code Style Total Downloads Latest Stable Version License

This is a thin wrapper around the SqlParser from the phpMyAdmin project which can be used to lint any amount of sql files from the command line.

Installation

Please use Composer to install:

composer require liquipedia/sqllint --dev

Usage

Command line utility

./vendor/bin/sqllint
./vendor/bin/sqllint --report=junit > report-junit.xml

Via composer script

Add this to your composer.json

{
	"require-dev": {
		"liquipedia/sqllint": "*"
	},
	"scripts": {
		"sqllint": [
			"sqllint"
		],
		"sqllint-junit": [
			"sqllint --report=junit > report-junit.xml"
		]
	}
}

and run

composer sqllint

Parameter

To check out parameters, please refer to the src/Parameters.php file or use the --help parameter.

.sqllint.json

Parameters for SqlLint can optionally also be provided via a .sqllint.json file in the project root. Parameters passed via command line always have precedence over the parameters set in .sqllint.json.

Example:

{
	"report": "junit"
}

About

A thin wrapper around the SqlParser from the phpMyAdmin project which can be used to lint any amount of sql files from the command line.

Topics

Resources

License

Stars

Watchers

Forks

Languages