[DB-SIG] Optional DB API Extensions
M.-A. Lemburg
mal@lemburg.com
Wed, 24 Oct 2001 12:56:14 +0200
Federico Di Gregorio wrote:
>
> On Wed, 2001-10-24 at 09:44, M.-A. Lemburg wrote:
> [snip]
> > > Cursor Attribute .lastrowid
> > >
> > > This read-only attribute provides the rowid of the last
> > > modified row (most databases return a rowid only when a single
> > > INSERT operation is performed.) If the operation does not set
> > > a rowid or if the database does not support rowids, this attribute
> > > should be set to None.
> >
> > Looks OK (though I don't know how many DBs actually implement something
> > like this; I know that MySQL does, but are there others ?).
>
> postgresql.
Ah, ok.
> > One nit: like with all attribute extensions, if the database
> > does not supply the feature the module should not implement the attribute
> > and if it cannot determine the value it should return -1
> > (this simplifies checking and is more in sync with the other attributes).
>
> i don't think it should return a numeric value. -1 _can_ be a valid
> rowid on some dbs. None is better, imho. i agree on raising
> NotImplemented if the db does not support rowids.
Oh, I didn't know that -1 was a valid ROWID (aren't these beast
unsigned integers ?). I'll use None then.
I also added some more text explaining how to handle these optional
extensions.
Do you have any other extensions which you'd like to see in the
new DB API section ?
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/