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

Matt S Trout dbix-class at trout.me.uk
Tue Nov 22 16:51:30 GMT 2005

On Mon, Nov 21, 2005 at 10:49:05PM -0500, Edward J. Sabol wrote:
> 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.

I can't say I'm overly surprised; I tried to use last_insert_id for
auto-increment columns in DBIx::Class and ran into a widely varying level
of support from different DBDs - with the result that DBIx::Class requires
the loading of an auto-PK plugin for the appropriate DB (although one of
us *will* get round to guessing it off the DBD at some point :)

     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

More information about the ClassDBI mailing list