From: Kieren Diment Date: Wed, 17 May 2006 09:49:18 +0000 (+0000) Subject: optimised last_insert_id example for searching X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74413b83f8caec561054d33b1bda187844f84fa0;p=dbsrgits%2FDBIx-Class-Historic.git optimised last_insert_id example for searching --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 809ea74..20efc71 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -788,9 +788,11 @@ method. =head2 Getting the value of the primary key for the last database insert +AKA getting last_insert_id + If you are using PK::Auto, this is straightforward: - my $foo = $rs->create({blah}); + my $foo = $rs->create(\%blah); # do more stuff my $id = $foo->id; # foo->my_primary_key_field will also work.