Re: [SQLObject] Unique ID Number question
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Scott C. <sco...@mi...> - 2003-10-02 20:59:28
|
On Thursday 02 October 2003 12:27, Luke Opperman wrote: > > Where does it learn that the new Person has an ID of 1? > > > > I tried the same commands manually and the insert doesn't return the ID. > > How does SQLObject know what the ID is? > > Depends on the database/dbdriver. You'll find the implementation in > SQlObject/DBConnection.py, _queryInsertID() for each DBConnection-class. > Some Python db interfaces provide a non-standard option for getting this > from the cursor (MySQL, SQLite), some require a second query of the > database (Postgres using OIDs, for instance). I'm using Postgres. It seems like OID's would be a good replacement for ID in this case (save some processing). However, I think they can roll over and that might cause a serious problem. Thanks for the answer. Cordially, Scott |