[Python-Dev] building sql queries in python (original) (raw)

Thomas Wouters thomas at python.org
Thu Mar 30 10:38:19 CEST 2006


On 3/30/06, Gregory P. Smith <greg at electricrain.com> wrote:

> Getting off on a tangent here, but I would actually > like some decent way of writing SQL queries in Python -- > not for importing, but for database access. > > Constructing bits of SQL out of character strings > sucks extremely badly. Have you looked at SqlObject? (and its associated modules sqlobject.sqlbuilder in particular)

SQLAlchemy (www.sqlalchemy.org) is also nice, in particular for more complex setups. I found it scales much better to the insanely complex SQL queries that our home-grown PostgreSQL/Perl setup needs, and it handles transactions the same way as our home-grown ORM too. There's plenty of ways to reliably and sanely avoid typing actual SQL in Python.

-- Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20060330/df1f8cb3/attachment.html



More information about the Python-Dev mailing list