How to format a SQL query into a more human-readable format?

abfouncutrav

New Member
I'm looking for a program that can take in an SQL string, (my environment is MySQL, but I could look at similar tools for other RDBMSs) parse it and render it again in a format that is more human-readable. I've seen some online ones, but I'm hoping for one that I can integrate into some internal logging tools.For example, taking:\[code\]SELECT * FROM table JOIN other_table ON table.id = other_table.id WHERE column = 'value' AND column = 'value'\[/code\]and converting it into:\[code\]SELECT *FROM table JOIN other_table ON table.id = other_table.idWHERE column = 'value' AND column = 'value'\[/code\]My environment is specifically PHP, but I wouldn't mind spending time porting code.
 
Back
Top