in reply to SQL pretty printer?

Not a complete solution, but you probably could use SQL::Statement to parse out the parts to apply formatting to presuming you can extract the query from the rest of the line (which shouldn't be too hard).