1 package DBIx::Class::Schema::Loader::DBI::Writing;
4 our $VERSION = '0.04003';
12 DBIx::Class::Schema::Loader::DBI::Writing - Loader subclass writing guide for DBI
16 package DBIx::Class::Schema::Loader::DBI::Foo;
18 # THIS IS JUST A TEMPLATE TO GET YOU STARTED.
22 use base 'DBIx::Class::Schema::Loader::DBI';
23 use Carp::Clan qw/^DBIx::Class/;
26 sub _table_uniq_info {
27 my ($self, $table) = @_;
29 # ... get UNIQUE info for $table somehow
30 # and return a data structure that looks like this:
33 [ 'keyname' => [ 'colname' ] ],
34 [ 'keyname2' => [ 'col1name', 'col2name' ] ],
35 [ 'keyname3' => [ 'colname' ] ],
38 # Where the "keyname"'s are just unique identifiers, such as the
39 # name of the unique constraint, or the names of the columns involved
40 # concatenated if you wish.
47 The only required method for new subclasses is C<_table_uniq_info>,
48 as there is not (yet) any standardized, DBD-agnostic way for obtaining
49 this information from DBI.
51 The base DBI Loader contains generic methods that *should* work for
52 everything else in theory, although in practice some DBDs need to
53 override one or more of the other methods. The other methods one might
54 likely want to override are: C<_table_pk_info>, C<_table_fk_info>, and
55 C<_tables_list>. See the included DBD drivers for examples of these.