jdorn / sql-formatter

A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.
http://jdorn.github.com/sql-formatter/
MIT License
3.89k stars 186 forks source link

Command line syntax highlighter: Adding in support for multiple queries. #73

Open kYuZz opened 9 years ago

kYuZz commented 9 years ago

Hi, I found your CLI command very useful and I love that I can pipe SQL into it, for example:

php app/console doctrine:schema:update --dump-sql | sql-formatter

However, when running commands that output multiple queries (like the one above), the formatting looks a bit strange. I added some very simple code that breaks multiple queries and formats them separately. I hope you'll be fine with adding it to your repository.

Again, thanks for your powerful SQL highlighter.

Sam