Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 906 Bytes

README.org

File metadata and controls

24 lines (18 loc) · 906 Bytes

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

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