Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

ioistired/sql-remove-comma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-remove-comma

Tests Status Coverage Status

Dumb command line script that removes illegal trailing commas from your SQL code.

Intended as a preprocessor for SQL that allows you to use trailing commas like you should be able to. This makes diffs easier.

Usage

$ sql-remove-comma
$ cat queries.sql
SELECT
	x,
	y,
	z,
FROM tab;

	SELECT
		0 AS sort_order,
		x,
		y,
		z,
	FROM tab1
UNION ALL
	SELECT
		1 AS sort_order,
		a,
		b,
		c,
	FROM tab2
$ sql-remove-comma < queries.sql
SELECT 
	x,
	y,	
	z
FROM tab;
SELECT
		0 AS sort_order,
		x,
		y,
		z
	FROM tab1
UNION ALL
	SELECT
		1 AS sort_order,
		a,	
		b,
		c
	FROM tab2 

License

BSD 2-clause + Patent. See the LICENSE file in this repository for details.

About

Removes illegal trailing commas from your SQL code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages