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:
SELECT * FROM table JOIN other_table ON table.id = other_table.id WHERE column = 'value' AND column = 'value'
and converting it into:
SELECT *
FROM table
JOIN other_table
ON table.id = other_table.id
WHERE column = 'value'
AND column = 'value'
My environment is specifically PHP, but I wouldn't mind spending time porting code.