1DBIx::Class::Schema::LoUasdeerr:C:oDnBtIr:i:bWuDrtBieItdxi:nP:geC(rl3la)sDso:c:uSmcehnetmaat:i:oLnoader::DBI::Writing(3)
2
3
4

NAME

6       DBIx::Class::Schema::Loader::DBI::Writing - Loader subclass writing
7       guide for DBI
8

SYNOPSIS

10         package DBIx::Class::Schema::Loader::DBI::Foo;
11
12         # THIS IS JUST A TEMPLATE TO GET YOU STARTED.
13
14         use strict;
15         use warnings;
16         use base 'DBIx::Class::Schema::Loader::DBI';
17         use Carp::Clan qw/^DBIx::Class/;
18         use mro 'c3';
19
20         sub _table_uniq_info {
21             my ($self, $table) = @_;
22
23             # ... get UNIQUE info for $table somehow
24             # and return a data structure that looks like this:
25
26             return [
27                [ 'keyname' => [ 'colname' ] ],
28                [ 'keyname2' => [ 'col1name', 'col2name' ] ],
29                [ 'keyname3' => [ 'colname' ] ],
30             ];
31
32             # Where the "keyname"'s are just unique identifiers, such as the
33             # name of the unique constraint, or the names of the columns involved
34             # concatenated if you wish.
35         }
36
37         sub _table_comment {
38             my ( $self, $table ) = @_;
39             return 'Comment';
40         }
41
42         sub _column_comment {
43             my ( $self, $table, $column_number ) = @_;
44             return 'Col. comment';
45         }
46
47         1;
48

DETAILS

50       The only required method for new subclasses is "_table_uniq_info", as
51       there is not (yet) any standardized, DBD-agnostic way for obtaining
52       this information from DBI.
53
54       The base DBI Loader contains generic methods that *should* work for
55       everything else in theory, although in practice some DBDs need to
56       override one or more of the other methods.  The other methods one might
57       likely want to override are: "_table_pk_info", "_table_fk_info",
58       "_tables_list" and "_extra_column_info".  See the included DBD drivers
59       for examples of these.
60

AUTHOR

62       See "AUTHOR" in DBIx::Class::Schema::Loader and "CONTRIBUTORS" in
63       DBIx::Class::Schema::Loader.
64

LICENSE

66       This library is free software; you can redistribute it and/or modify it
67       under the same terms as Perl itself.
68
69       To import comments from database you need to implement
70       "_table_comment", "_column_comment"
71
72
73
74perl v5.12.2                      2D0B1I0x-:0:9C-l1a1ss::Schema::Loader::DBI::Writing(3)
Impressum