I'm looking for an object-oriented toolkit that will do for SQL what Perl's CGI.pm module, or Python's HTMLgen, does for HTML. Pointers, examples, or expressions of interest would be welcome.
Lincoln Stein's CGI.pm module for Perl allows me to build HTML in an object-oriented way, instead of getting caught in the Turing tarpit of string substitution and printf. DOM does the same (in a variety of languages) for XML.
Right now, if I want to interact with an SQL database from Perl or Python, I have to embed SQL strings in my programs. I would like to have a DOM-like ability to build and manipulate queries as objects, then call a method that translate the query structure into SQL to send to the database. Alternatively, if there is an XML DTD for SQL (how's that for a chain of TLAs?), and some tool to convert the XML/SQL to pure SQL, so that I could build my query using DOM, that would be cool too.
Greg Wilson email@example.com