Skip to content

praetoriansentry/tsql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 here for more details.

Screenshot

https://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

About

Transact-SQL Formatter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages