On 9/11/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
Yeah I realize that Sequence doesn't map so great, but one really nice feature about reusing it like that it that allows a single SA schema definition to be created that will work correctly in MSSQL, Postgres, and Oracle. I would hate to lose that.
Well, some pretty basic unit tests such as tables.py use explicit values for columns that have a Sequence() definition. Would be nice to pass at least the simple tests.
Yep it's per-connection, so concurrency is not an issue. I've made this an optional feature using the keyword 'auto_identity_insert'. It's a connection-time value like 'use_oids', and is False by default, so will run at full speed. I'd rather not lose the feature completely, it's conceivably useful.
Sequence doesnt map super-great either since you can also execute a Sequence by itself using its execute() method....but it is a nice place to put the start value/auto-increment.
Yeah I realize that Sequence doesn't map so great, but one really nice feature about reusing it like that it that allows a single SA schema definition to be created that will work correctly in MSSQL, Postgres, and Oracle. I would hate to lose that.
having failing unit tests is a requirement for pretty much every database there is since no DB that supports every behavior; thats why we have the "@unsupported" decorator in the unittests.
Well, some pretty basic unit tests such as tables.py use explicit values for columns that have a Sequence() definition. Would be nice to pass at least the simple tests.
I cant see when the "SET IDENTITY_INSERT" trick would be appropriate; since SA is literally going to turn it on and off for individual rows which probably obliterates performance, and i would think it blows away any hope of proper concurrent behavior as well (unless the once-per-table restriciton is only per-connection?).
Yep it's per-connection, so concurrency is not an issue. I've made this an optional feature using the keyword 'auto_identity_insert'. It's a connection-time value like 'use_oids', and is False by default, so will run at full speed. I'd rather not lose the feature completely, it's conceivably useful.
On Sep 11, 2006, at 10:16 AM, Rick Morrison wrote:The column definition in MSSQL already allows the specification of an IDENTITY column by using the Sequence() class; see the MSSQL module header docstring for some details.
Getting rid of the auto-magic IDENTITY_INSERT on/off should be easy, but it will make several basic unit tests fail -- maybe making that behavior switchable w/b better?
RickOn 9/11/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
On Sep 10, 2006, at 9:55 PM, Rick Morrison wrote:
> Oh, it gets even better. You can only have IDENTITY_INSERT on for
> one table at a time. Trying to set it on for another table while it
> is set on elsewhere will throw an error. It is necessary to turn it
> off first, then set it on for the other table.
>
Ok the "IDENTITY_INSERT" is only when you are inserting an *explicit*
value into an IDENTITY column, right ? i would rather just allow
users to choose IDENTITY or not, using a flag on Column such as
"autoincrement=True". obviously it defaults to True right now, but
for databases that cant handle switching (like ms-sql), you can turn
it off and get a non-IDENTITY column. lets take that SET
IDENTITY_INSERT stuff out, thats not going to scale at all; it
appears that its intended for batch loads and isnt really appropriate
within an application flow.-------------------------------------------------------------------------Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache GeronimoSqlalchemy-users mailing list
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users