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 __PACKAGE__->load_components(qw/Core/);
15 __PACKAGE__->set_primary_key('id');
19 This class overrides the insert method to get automatically incremented primary
22 __PACKAGE__->load_components(qw/Core/);
24 PK::Auto is now part of Core.
26 See L<DBIx::Class::Manual::Component> for details of component interactions.
30 C<PK::Auto> does this by letting the database assign the primary key field and
31 fetching the assigned value afterwards.
37 The code that was handled here is now in Row for efficiency.
41 Manually define the correct sequence for your table, to avoid the overhead
42 associated with looking up the sequence automatically.
48 foreach my $pri ($self->primary_columns) {
49 $self->column_info($pri)->{sequence} = $seq;
57 Matt S. Trout <mst@shadowcatsystems.co.uk>
61 You may distribute this code under the same terms as Perl itself.