req: OO SQL gen module?

Bjorn Pettersen bjorn at roguewave.com
Sun Mar 5 17:32:55 EST 2000


A while ago I was attempting to swig a c++ library that did exactly this, but
ran into problems when I couldn't overload the individual comparison operators
for a python class, e.g. consider (assuming Table.__getitem__() returns a Column
object):

    t = Table('foo')
    s = Select( t['col1'], t['col2'] )
    s.where( t['col3'] > 5 )  # oops, not possible

back when I was doing this, people were saying comparison operator overloads
would be implemented in 1.6, but I don't know if that has happened...

-- bjorn


Greg Wilson wrote:

> [apologies if this is a repeated post --- ISP problems]
>
> I am looking for a module that does for SQL what Perl's CGI.pm, Python's
> HTMLgen, and DOM libraries in various languages do for HTML and XML.  Right
> now, both Perl and Python require me to manipulate SQL at the string level.
> Tools like CGI.pm, HTMLgen, and DOM, on the other hand, let me manipulate
> trees at the semantic level, and then translate the tree structure into text
> when necessary. This seems like the right way to build, store, and
> manipulate SQL queries.
>
> If anyone has done something like this (in any language), I'd be grateful
> for pointers or references. Please mail me directly (gvwilson at nevex dot
> com), as I am not a regular reader of all of these groups.
>
> Thanks,
> Greg
>
> --
> http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list