Re: [sqlalchemy] autocommit on for DDL

2011-01-27 Thread A.M.
On Jan 26, 2011, at 7:47 PM, Michael Bayer wrote: On Jan 26, 2011, at 6:32 PM, A.M. wrote: Well, I spoke too soon :( What is the mistake in the following sample code which causes the COMMITs to be emitted? Setting autocommit to either True or False emits the same SQL. I think this is a

[sqlalchemy] autocommit on for DDL

2011-01-26 Thread A.M.
Hello, While working on a database test with nose, I dug into sqlalchemy 0.6.6 until I found these lines: class DDLElement(expression.Executable, expression.ClauseElement): Base class for DDL expression constructs. _execution_options = expression.Executable.\

Re: [sqlalchemy] autocommit on for DDL

2011-01-26 Thread Michael Bayer
On Jan 26, 2011, at 5:16 PM, A.M. wrote: Hello, While working on a database test with nose, I dug into sqlalchemy 0.6.6 until I found these lines: class DDLElement(expression.Executable, expression.ClauseElement): Base class for DDL expression constructs. _execution_options =

Re: [sqlalchemy] autocommit on for DDL

2011-01-26 Thread A.M.
On Jan 26, 2011, at 5:45 PM, Michael Bayer wrote: From this it follows that if you'd like to emit several DDL statements in a transaction, the usage is no different for DDL expressions than for any other kind of DML statement (i.e insert/update/delete). Use

Re: [sqlalchemy] autocommit on for DDL

2011-01-26 Thread A.M.
Well, I spoke too soon :( What is the mistake in the following sample code which causes the COMMITs to be emitted? Setting autocommit to either True or False emits the same SQL. I think this is a case of staring at the same code too long causing brain damage- thanks for your patience and help!

Re: [sqlalchemy] autocommit on for DDL

2011-01-26 Thread Michael Bayer
On Jan 26, 2011, at 6:10 PM, A.M. wrote: Thanks for the prodding- I figured out my bug. Here is sample code that demonstrates a little surprise. First, this code that emits: BEGIN (implicit) SELECT 1 ROLLBACK = from sqlalchemy.engine import create_engine

Re: [sqlalchemy] autocommit on for DDL

2011-01-26 Thread Michael Bayer
On Jan 26, 2011, at 6:32 PM, A.M. wrote: Well, I spoke too soon :( What is the mistake in the following sample code which causes the COMMITs to be emitted? Setting autocommit to either True or False emits the same SQL. I think this is a case of staring at the same code too long causing