--On 30. April 2007 19:34:41 +0000 Ian Charnas <[EMAIL PROTECTED]> wrote:


Yes!  While most *any* query can be done using sqlalchemy... and you
*should* try to use sqlalchemy because then if you change databases
you won't have to go through all your code and figure out if any of
the sql is different.... if you're absolutely sure you really really
need to do a bare sql query, you can do this:

from sqlalchemy import *
engine = create_engine("sqlite:///test.db")
engine.execute("insert into people(first_name, last_name)
values('ian', 'charnas')")
engine.execute("select * from people").fetchall()
[(1, 'ian', 'charnas')]

note that metadata keeps track of tables, and session keeps track of
instances of mapped classes, so to do this you don't need to use
metadata or session whatsoever.

Creating/re-using a connection on a pre-Zope-transaction basis resolved my
problem.

Andreas

Attachment: pgpFgqQBpDCtx.pgp
Description: PGP signature

Reply via email to