While it seems like a rather useless method these days (we have excellent sequence
detection) keep it around nevertheless. However move it to ResultSource where
it logically belongs, and undocument its use from a couple of ::Storage driver
POD examples
use strict;
use warnings;
+1;
+
=head1 NAME
DBIx::Class::PK::Auto - Automatic primary key class
=head2 sequence
-Manually define the correct sequence for your table, to avoid the overhead
-associated with looking up the sequence automatically.
-
-=cut
-
-sub sequence {
- my ($self,$seq) = @_;
- foreach my $pri ($self->primary_columns) {
- $self->column_info($pri)->{sequence} = $seq;
- }
-}
-
-1;
+The code that was handled here is now in ResultSource, and is being proxied to
+Row as well.
=head1 AUTHORS
return @pcols;
}
+=head2 sequence
+
+Manually define the correct sequence for your table, to avoid the overhead
+associated with looking up the sequence automatically. The supplied sequence
+will be applied to the L</column_info> of each L<primary_key|/set_primary_key>
+
+=over 4
+
+=item Arguments: $sequence_name
+
+=item Return value: undefined
+
+=back
+
+=cut
+
+sub sequence {
+ my ($self,$seq) = @_;
+ foreach my $pri ($self->primary_columns) {
+ $self->column_info($pri)->{sequence} = $seq;
+ }
+}
+
+
=head2 add_unique_constraint
=over 4
set_primary_key
primary_columns
_pri_cols
+ sequence
add_unique_constraint
add_unique_constraints
use base 'DBIx::Class::Core';
__PACKAGE__->add_columns({ id => { sequence => 'mysequence', auto_nextval => 1 } });
__PACKAGE__->set_primary_key('id');
- __PACKAGE__->sequence('mysequence');
# Somewhere in your Code
# add some data to a table with a hierarchical relationship
# In your result (table) classes
use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
- __PACKAGE__->sequence('mysequence');
=head1 DESCRIPTION