1 package DBIx::Class::PK::Auto;
3 #use base qw/DBIx::Class::PK/;
4 use base qw/DBIx::Class/;
10 DBIx::Class::PK::Auto - Automatic primary key class
14 use base 'DBIx::Class::Core';
15 __PACKAGE__->set_primary_key('id');
19 This class overrides the insert method to get automatically incremented primary
22 PK::Auto is now part of Core.
24 See L<DBIx::Class::Manual::Component> for details of component interactions.
28 C<PK::Auto> does this by letting the database assign the primary key field and
29 fetching the assigned value afterwards.
35 The code that was handled here is now in Row for efficiency.
39 Manually define the correct sequence for your table, to avoid the overhead
40 associated with looking up the sequence automatically.
46 foreach my $pri ($self->primary_columns) {
47 $self->column_info($pri)->{sequence} = $seq;
55 Matt S. Trout <mst@shadowcatsystems.co.uk>
59 You may distribute this code under the same terms as Perl itself.