Prettyprinting SQL statements

MooJoo flossy at bobbsey_twins.com
Sat May 10 23:23:53 EDT 2008


I'm building a Python app that will be making queries to a MySQL server 
using the MySQLdb module. The app will need to create SQL statements on 
the fly which, in addition to going to the server, will occasionally 
need to be displayed to the user. While these queries are not too 
complex, they still can be difficult to decipher without doing some 
formatting. I've done the requisite Googling to see if a library to 
format SQL can be found but, other than commericial Windows apps and 
some on-line formatters, I've not found anything remotely usable. Before 
trying to write my own parser/formatter, I was hoping somebody might 
know of a package to perform this function.

Anybody? Ferris? Anybody at all?

Thanks.



More information about the Python-list mailing list