Bump version for 0.04006 release
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Writing.pm
CommitLineData
996be9ee 1package DBIx::Class::Schema::Loader::DBI::Writing;
2use strict;
3
eb1de218 4our $VERSION = '0.04006';
32f784fc 5
996be9ee 6# Empty. POD only.
7
81;
9
10=head1 NAME
11
12DBIx::Class::Schema::Loader::DBI::Writing - Loader subclass writing guide for DBI
13
14=head1 SYNOPSIS
15
16 package DBIx::Class::Schema::Loader::DBI::Foo;
17
18 # THIS IS JUST A TEMPLATE TO GET YOU STARTED.
19
20 use strict;
21 use warnings;
22 use base 'DBIx::Class::Schema::Loader::DBI';
fa994d3c 23 use Carp::Clan qw/^DBIx::Class/;
996be9ee 24 use Class::C3;
25
26 sub _table_uniq_info {
27 my ($self, $table) = @_;
28
29 # ... get UNIQUE info for $table somehow
30 # and return a data structure that looks like this:
31
32 return [
33 [ 'keyname' => [ 'colname' ] ],
34 [ 'keyname2' => [ 'col1name', 'col2name' ] ],
35 [ 'keyname3' => [ 'colname' ] ],
36 ];
37
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.
41 }
42
43 1;
44
45=head1 DETAILS
46
47The only required method for new subclasses is C<_table_uniq_info>,
25328cc4 48as there is not (yet) any standardized, DBD-agnostic way for obtaining
49this information from DBI.
996be9ee 50
51The base DBI Loader contains generic methods that *should* work for
52everything else in theory, although in practice some DBDs need to
53override one or more of the other methods. The other methods one might
b15c5735 54likely want to override are: C<_table_pk_info>, C<_table_fk_info>,
55C<_tables_list> and C<_extra_column_info>. See the included DBD drivers
56for examples of these.
996be9ee 57
58=cut
59
601;