Hello,

I try to use SQLAlchemy in buildscripts for SCons, so I run my SCons script 
and depend on the data all tables are created.
I'm new with SQLAlchemy and Python database access, so can I create a 
transaction with SQLAlchemy for the create table
statements and also the insert statements, so if one of them creates an 
error, the full transaction is rollbacked ?

I think I need something like:
try 
start_transaction()
metadata.drop_all
metadata.create_all

metadata.insert
insert.execute
commit_transaction()
except :
    rollback_transaction()

Can anybody explain me please, in which case I can add a transaction around 
the drop and create and the insert calls.

Thanks a lot

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to