line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hide from PAUSE |
2
|
|
|
|
|
|
|
DBIx::Class::Storage::DBI::Replicated::Types; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# DBIx::Class::Storage::DBI::Replicated::Types - Types used internally by |
5
|
|
|
|
|
|
|
# L<DBIx::Class::Storage::DBI::Replicated> |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Workaround for https://rt.cpan.org/Public/Bug/Display.html?id=83336 |
8
|
2
|
|
|
2
|
|
2399
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
64
|
|
9
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
64
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use MooseX::Types |
12
|
2
|
|
|
2
|
|
295
|
-declare => [qw/BalancerClassNamePart Weight DBICSchema DBICStorageDBI/]; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use MooseX::Types::Moose qw/ClassName Str Num/; |
14
|
|
|
|
|
|
|
use MooseX::Types::LoadableClass qw/LoadableClass/; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
class_type 'DBIx::Class::Storage::DBI'; |
17
|
|
|
|
|
|
|
class_type 'DBIx::Class::Schema'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
subtype DBICSchema, as 'DBIx::Class::Schema'; |
20
|
|
|
|
|
|
|
subtype DBICStorageDBI, as 'DBIx::Class::Storage::DBI'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
subtype BalancerClassNamePart, |
23
|
|
|
|
|
|
|
as LoadableClass; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
coerce BalancerClassNamePart, |
26
|
|
|
|
|
|
|
from Str, |
27
|
|
|
|
|
|
|
via { |
28
|
|
|
|
|
|
|
my $type = $_; |
29
|
|
|
|
|
|
|
$type =~ s/\A::/DBIx::Class::Storage::DBI::Replicated::Balancer::/; |
30
|
|
|
|
|
|
|
$type; |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
subtype Weight, |
34
|
|
|
|
|
|
|
as Num, |
35
|
|
|
|
|
|
|
where { $_ >= 0 }, |
36
|
|
|
|
|
|
|
message { 'weight must be a decimal greater than 0' }; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |