[DB-SIG] Optional DB API Extensions

Federico Di Gregorio fog@debian.org
24 Oct 2001 11:04:29 +0200


On Wed, 2001-10-24 at 09:44, M.-A. Lemburg wrote:
[snip]
> >      Cursor Attribute .lastrowid
> >=20
> >          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 attri=
bute
> >          should be set to None.
>=20
> Looks OK (though I don't know how many DBs actually implement something
> like this; I know that MySQL does, but are there others ?).=20

postgresql.

> One nit: like with all attribute extensions, if the database=20
> does not supply the feature the module should not implement the attribute
> and if it cannot determine the value it should return -1=20
> (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.

ciao,
federico

--=20
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
INIT.D Developer                                           fog@initd.org
  Spesso crescere ed andare a vivere da soli =E8 l'unico modo di restare
   bambini.                                             -- Alice Fontana