1 package DBIx::Class::Storage::DBI::Replicated::Replicant;
7 DBIx::Class::Storage::DBI::Replicated::Replicant; A replicated DBI Storage Role
11 This class is used internally by L<DBIx::Class::Storage::DBI::Replicated>.
15 Replicants are DBI Storages that follow a master DBI Storage. Typically this
16 is accomplished via an external replication system. Please see the documents
17 for L<DBIx::Class::Storage::DBI::Replicated> for more details.
19 This class exists to define methods of a DBI Storage that only make sense when
20 it's a classic 'slave' in a pool of slave databases which replicate from a
21 given master database.
25 This class defines the following attributes.
29 This is a boolean which allows you to programmatically activate or deactivate a
30 replicant from the pool. This way to you do stuff like disallow a replicant
31 when it get's too far behind the master, if it stops replicating, etc.
33 This attribute DOES NOT reflect a replicant's internal status, i.e. if it is
34 properly replicating from a master and has not fallen too many seconds behind a
35 reliability threshold. For that, use L</is_replicating> and L</lag_behind_master>.
36 Since the implementation of those functions database specific (and not all DBIC
37 supported DB's support replication) you should refer your database specific
38 storage driver for more information.
52 This class defines the following methods.
54 =head2 after: _query_start
56 advice iof the _query_start method to add more debuggin
60 around '_query_start' => sub {
61 my ($method, $self, $sql, @bind) = @_;
62 my $dsn = $self->connect_info->[0];
63 $self->$method("DSN: $dsn SQL: $sql", @bind);
69 John Napiorkowski <john.napiorkowski@takkle.com>
73 You may distribute this code under the same terms as Perl itself.