1Catalyst::TraitFor::ModUesleC:ra:tDCaBolInyCts:rt:i:Sb:cuThtreeamdiat:PF:eoRrrel:p:lDMiooccdauetmlee:dn:(tD3aB)tIiCo:n:Schema::Replicated(3)
2
3
4
6 Catalyst::TraitFor::Model::DBIC::Schema::Replicated - Replicated
7 storage support for Catalyst::Model::DBIC::Schema
8
10 __PACKAGE__->config({
11 traits => ['Replicated']
12 connect_info =>
13 ['dbi:mysql:master', 'user', 'pass'],
14 replicants => [
15 ['dbi:mysql:slave1', 'user', 'pass'],
16 ['dbi:mysql:slave2', 'user', 'pass'],
17 ['dbi:mysql:slave3', 'user', 'pass'],
18 ],
19 balancer_args => {
20 master_read_weight => 0.3
21 }
22 });
23
25 Sets your storage_type to DBIx::Class::Storage::DBI::Replicated and
26 connects replicants provided in config. See that module for supported
27 resultset attributes.
28
29 The default "balancer_type" in DBIx::Class::Storage::DBI::Replicated is
30 "::Random".
31
32 Sets the "master_read_weight" in
33 DBIx::Class::Storage::DBI::Replicated::Balancer::Random to 1 by
34 default, meaning that you have the same chance of reading from master
35 as you do from replicants. Set to 0 to turn off reads from master.
36
38 replicants
39 Array of connect_info settings for every replicant.
40
41 The following can be set via "connect_info" in
42 Catalyst::Model::DBIC::Schema, or as their own parameters. If set via
43 separate parameters, they will override the settings in "connect_info".
44
45 pool_type
46 See "pool_type" in DBIx::Class::Storage::DBI::Replicated.
47
48 pool_args
49 See "pool_args" in DBIx::Class::Storage::DBI::Replicated.
50
51 balancer_type
52 See "balancer_type" in DBIx::Class::Storage::DBI::Replicated.
53
54 balancer_args
55 See "balancer_args" in DBIx::Class::Storage::DBI::Replicated.
56
58 Catalyst::Model::DBIC::Schema, DBIx::Class,
59 DBIx::Class::Storage::DBI::Replicated,
60 Catalyst::TraitFor::Model::DBIC::Schema::Caching
61
63 See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in
64 Catalyst::Model::DBIC::Schema.
65
67 See "COPYRIGHT" in Catalyst::Model::DBIC::Schema.
68
70 This program is free software, you can redistribute it and/or modify it
71 under the same terms as Perl itself.
72
73
74
75perl v5.38.0 Catalyst::2T0r2a3i-t0F7o-r3:1:Model::DBIC::Schema::Replicated(3)