1 package DBIx::Class::Schema::Loader::DBI::Writing;
4 our $VERSION = '0.07025';
10 DBIx::Class::Schema::Loader::DBI::Writing - Loader subclass writing guide for DBI
14 package DBIx::Class::Schema::Loader::DBI::Foo;
16 # THIS IS JUST A TEMPLATE TO GET YOU STARTED.
20 use base 'DBIx::Class::Schema::Loader::DBI';
23 sub _table_uniq_info {
24 my ($self, $table) = @_;
26 # ... get UNIQUE info for $table somehow
27 # and return a data structure that looks like this:
30 [ 'keyname' => [ 'colname' ] ],
31 [ 'keyname2' => [ 'col1name', 'col2name' ] ],
32 [ 'keyname3' => [ 'colname' ] ],
35 # Where the "keyname"'s are just unique identifiers, such as the
36 # name of the unique constraint, or the names of the columns involved
37 # concatenated if you wish.
41 my ( $self, $table ) = @_;
46 my ( $self, $table, $column_number ) = @_;
47 return 'Col. comment';
54 The only required method for new subclasses is C<_table_uniq_info>,
55 as there is not (yet) any standardized, DBD-agnostic way for obtaining
56 this information from DBI.
58 The base DBI Loader contains generic methods that *should* work for
59 everything else in theory, although in practice some DBDs need to
60 override one or more of the other methods. The other methods one might
61 likely want to override are: C<_table_pk_info>, C<_table_fk_info>,
62 C<_tables_list> and C<_extra_column_info>. See the included DBD drivers
63 for examples of these.
65 To import comments from the database you need to implement C<_table_comment>,
70 See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
74 This library is free software; you can redistribute it and/or modify it under
75 the same terms as Perl itself.