[CDBI] Re: DBI's last_insert_id and Class::DBI's _auto_increment_value

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Tue Nov 22 03:49:05 GMT 2005


David Steinbrunner wrote:
> It seems to me that using last_insert_id in the _auto_increment_value
> method would not only clean up the code for that method but make it so that
> you would not have to define a sequence and be more database agnostic.

I completely agree with you. Tim Bunce brought up this same issue on the old
Class::DBI mailing, and I thought he had convinced Tony Bowden to change the
_auto_increment_value code to use DBI's last_insert_id, but it appears Tony
Bowden never implemnted the change.

Here's what I would suggest: File a Class::DBI bug report at
http://rt.cpan.org/ and attach a patch against Class::DBI v3.0.12 that
changes _auto_increment_value to use DBI's last_insert_id. You might want to
also include your test case because Tony loves test cases, but the CDBI test
suite doesn't run on PostgreSQL, so I don't know that it will be all that
useful to Tony. It will still give weight to your bug report, however.

Hope this helps,
Ed




More information about the ClassDBI mailing list