Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/praetoriansentry/tsql
Transact-SQL Formatter
https://github.com/praetoriansentry/tsql
Last synced: about 7 hours ago
JSON representation
Transact-SQL Formatter
- Host: GitHub
- URL: https://github.com/praetoriansentry/tsql
- Owner: praetoriansentry
- License: gpl-2.0
- Created: 2014-01-25T00:24:16.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-05T20:36:29.000Z (over 10 years ago)
- Last Synced: 2023-03-11T10:07:53.263Z (over 1 year ago)
- Language: C#
- Size: 309 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* TSQL Formatter
I use Microsoft SQL Server all the time at work. I've been having a
very difficult time finding a formatter for Transact SQL that formats
the code in a way that I like. Since I couldn't find one, I thought
it would be a good idea to write one!It has also be quite difficult to find a good lexer / parser for
TSQL. The only one that I could find was part of the SQL Server
class library. Check [[http://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.sqlparser.parser.aspx][here]] for more details.** Screenshot
[[http://i.imgur.com/aOS0ZMl.png]]
** Future Stuff
- Add configuration support
- Properly indentation for ~AND~ and ~OR~ clauses that are nested
within parenthesis
- Add unit testing?
- For special cases like ~CREATE~, ~UPDATE~, ~DELETE~ reset the
clause stack... assuming these aren't statements.
- Making the spacing around ()'s more normal