Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::schema::loader::dbi::writing(3pm) [debian man page]

DBIx::Class::Schema::Loader::DBI::Writing(3pm)		User Contributed Perl Documentation	    DBIx::Class::Schema::Loader::DBI::Writing(3pm)

NAME
DBIx::Class::Schema::Loader::DBI::Writing - Loader subclass writing guide for DBI SYNOPSIS
package DBIx::Class::Schema::Loader::DBI::Foo; # THIS IS JUST A TEMPLATE TO GET YOU STARTED. use strict; use warnings; use base 'DBIx::Class::Schema::Loader::DBI'; use mro 'c3'; sub _table_uniq_info { my ($self, $table) = @_; # ... get UNIQUE info for $table somehow # and return a data structure that looks like this: return [ [ 'keyname' => [ 'colname' ] ], [ 'keyname2' => [ 'col1name', 'col2name' ] ], [ 'keyname3' => [ 'colname' ] ], ]; # Where the "keyname"'s 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 'Comment'; } sub _column_comment { my ( $self, $table, $column_number ) = @_; return 'Col. comment'; } 1; DETAILS
The only required method for new subclasses is "_table_uniq_info", as there is not (yet) any standardized, DBD-agnostic way for obtaining this information from DBI. The base DBI 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: "_table_pk_info", "_table_fk_info", "_tables_list" and "_extra_column_info". See the included DBD drivers for examples of these. To import comments from the database you need to implement "_table_comment", "_column_comment" AUTHOR
See "AUTHOR" in DBIx::Class::Schema::Loader and "CONTRIBUTORS" in DBIx::Class::Schema::Loader. LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-08 DBIx::Class::Schema::Loader::DBI::Writing(3pm)

Check Out this Related Man Page

Catalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)User Contributed Perl DocumentatioCatalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)

NAME
Catalyst::TraitFor::Model::DBIC::Schema::Replicated - Replicated storage support for Catalyst::Model::DBIC::Schema SYNOPSiS __PACKAGE__->config({ traits => ['Replicated'] connect_info => ['dbi:mysql:master', 'user', 'pass'], replicants => [ ['dbi:mysql:slave1', 'user', 'pass'], ['dbi:mysql:slave2', 'user', 'pass'], ['dbi:mysql:slave3', 'user', 'pass'], ], balancer_args => { master_read_weight => 0.3 } }); DESCRIPTION
Sets your storage_type to DBIx::Class::Storage::DBI::Replicated and connects replicants provided in config. See that module for supported resultset attributes. The default "balancer_type" in DBIx::Class::Storage::DBI::Replicated is "::Random". Sets the "master_read_weight" in DBIx::Class::Storage::DBI::Replicated::Balancer::Random to 1 by default, meaning that you have the same chance of reading from master as you do from replicants. Set to 0 to turn off reads from master. CONFIG PARAMETERS
replicants Array of connect_info settings for every replicant. The following can be set via "connect_info" in Catalyst::Model::DBIC::Schema, or as their own parameters. If set via separate parameters, they will override the settings in "connect_info". pool_type See "pool_type" in DBIx::Class::Storage::DBI::Replicated. pool_args See "pool_args" in DBIx::Class::Storage::DBI::Replicated. balancer_type See "balancer_type" in DBIx::Class::Storage::DBI::Replicated. balancer_args See "balancer_args" in DBIx::Class::Storage::DBI::Replicated. SEE ALSO
Catalyst::Model::DBIC::Schema, DBIx::Class, DBIx::Class::Storage::DBI::Replicated, Catalyst::TraitFor::Model::DBIC::Schema::Caching AUTHOR
See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema. COPYRIGHT
See "COPYRIGHT" in Catalyst::Model::DBIC::Schema. LICENSE
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-05-15 Catalyst::TraitFor::Model::DBIC::Schema::Replicated(3pm)
Man Page