Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Sqlfluff | 6,175 | 12 | 13 hours ago | 80 | July 03, 2022 | 361 | mit | Python | ||
A modular SQL linter and auto-formatter with support for multiple dialects and templated code. | ||||||||||
Sql Formatter | 3,890 | 25,623 | 93 | a year ago | 6 | January 12, 2014 | 37 | mit | HTML | |
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting. | ||||||||||
Spotless | 3,518 | 7 | 11 | 15 hours ago | 124 | September 14, 2022 | 139 | apache-2.0 | Java | |
Keep your code spotless | ||||||||||
Pg Promise | 3,320 | 4,811 | 453 | 12 days ago | 592 | August 27, 2022 | mit | JavaScript | ||
PostgreSQL interface for Node.js | ||||||||||
Sql Formatter | 1,625 | 156 | 151 | 17 days ago | 56 | July 16, 2022 | 35 | mit | TypeScript | |
A whitespace formatter for different query languages | ||||||||||
Pgformatter | 1,468 | a month ago | 2 | March 02, 2018 | 21 | postgresql | PLpgSQL | |||
A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI. On-line demo site at http://sqlformat.darold.net/ | ||||||||||
Sql Formatter | 1,307 | 9 | 10 months ago | 11 | January 12, 2014 | 11 | mit | HTML | ||
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting. | ||||||||||
Poormanstsqlformatter | 805 | 10 months ago | 1 | November 22, 2018 | 144 | agpl-3.0 | JavaScript | |||
A small free .Net and JS library (with demo UI, command-line bulk formatter, SSMS/VS add-in, notepad++ plugin, winmerge plugin, and demo webpage) for reformatting and coloring T-SQL code to the user's preferences. | ||||||||||
Coolformat | 324 | 4 years ago | 41 | C++ | ||||||
CoolFormat Source Code Formatter | ||||||||||
Niceql | 296 | 6 | 7 | 7 months ago | 33 | November 19, 2022 | mit | Ruby | ||
niceql gem repo. Nice, colorized SQL formatting in ruby. |
C# SQL statement formatter class
update a set a.ID = b.ID, Name = b.Name from Table1 a inner join (select ID, Name from Table2 where Active <> 0 and Current <> 0) b on a.ownerid = b.ownerid and a.type = b.type and b.version = '87.1' and a.Name is Null where a.expired <> 0
becomes
update a set a.ID = b.ID, Name = b.Name from Table1 a inner join ( select ID, Name from Table2 where Active <> 0 and Current <> 0 ) b on a.ownerid = b.ownerid and a.type = b.type and b.version = '87.1' and a.Name is NULL where a.expired <> 0
The solution includes a simple winforms demo executable along with the Formatter class. The implementation of the formatter employs a number of routines from unrelated libraried code; I've pulled these fragments into an additional file: LIB.cs.