.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "DBIx::Class::Schema::Loader::DBI::Writing 3pm" .TH DBIx::Class::Schema::Loader::DBI::Writing 3pm "2018-04-19" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" DBIx::Class::Schema::Loader::DBI::Writing \- Loader subclass writing guide for DBI .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& package DBIx::Class::Schema::Loader::DBI::Foo; \& \& # THIS IS JUST A TEMPLATE TO GET YOU STARTED. \& \& use strict; \& use warnings; \& use base \*(AqDBIx::Class::Schema::Loader::DBI\*(Aq; \& use mro \*(Aqc3\*(Aq; \& \& sub _table_uniq_info { \& my ($self, $table) = @_; \& \& # ... get UNIQUE info for $table somehow \& # and return a data structure that looks like this: \& \& return [ \& [ \*(Aqkeyname\*(Aq => [ \*(Aqcolname\*(Aq ] ], \& [ \*(Aqkeyname2\*(Aq => [ \*(Aqcol1name\*(Aq, \*(Aqcol2name\*(Aq ] ], \& [ \*(Aqkeyname3\*(Aq => [ \*(Aqcolname\*(Aq ] ], \& ]; \& \& # Where the "keyname"\*(Aqs are just unique identifiers, such as the \& # name of the unique constraint, or the names of the columns involved \& # concatenated if you wish. \& } \& \& sub _table_comment { \& my ( $self, $table ) = @_; \& return \*(AqComment\*(Aq; \& } \& \& sub _column_comment { \& my ( $self, $table, $column_number ) = @_; \& return \*(AqCol. comment\*(Aq; \& } \& \& 1; .Ve .SH "DETAILS" .IX Header "DETAILS" The only required method for new subclasses is \f(CW\*(C`_table_uniq_info\*(C'\fR, as there is not (yet) any standardized, DBD-agnostic way for obtaining this information from \s-1DBI.\s0 .PP The base \s-1DBI\s0 Loader contains generic methods that *should* work for everything else in theory, although in practice some DBDs need to override one or more of the other methods. The other methods one might likely want to override are: \f(CW\*(C`_table_pk_info\*(C'\fR, \f(CW\*(C`_table_fk_info\*(C'\fR, \&\f(CW\*(C`_tables_list\*(C'\fR and \f(CW\*(C`_extra_column_info\*(C'\fR. See the included \s-1DBD\s0 drivers for examples of these. .PP To import comments from the database you need to implement \f(CW\*(C`_table_comment\*(C'\fR, \&\f(CW\*(C`_column_comment\*(C'\fR .SH "AUTHORS" .IX Header "AUTHORS" See \*(L"\s-1AUTHORS\*(R"\s0 in DBIx::Class::Schema::Loader. .SH "LICENSE" .IX Header "LICENSE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.