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.

On Apr 30, 10:04 am, Andreas Jung <[EMAIL PROTECTED]> wrote:
> I have a scenario where we I need to execute SQL directly within a
> transaction that is local to a Python thread. Is there some way to this in
> SA? In this particular usecase there is no UOW involved. Or is it somehow
> to pass a SQL statement somehow to the session and its underlaying
> framework?
>
> Andreas
>
>  application_pgp-signature_part
> 1KDownload


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to