line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::DBIx::Connector; |
2
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
929678
|
use DBIx::Connector; |
|
3
|
|
|
|
|
59092
|
|
|
3
|
|
|
|
|
103
|
|
5
|
3
|
|
|
3
|
|
25
|
use Types::Standard qw( InstanceOf ); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
31
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1718
|
use Moo::Role; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
29
|
|
8
|
3
|
|
|
3
|
|
1023
|
use strictures 2; |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
110
|
|
9
|
3
|
|
|
3
|
|
576
|
use namespace::clean; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
27
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Curio::Role'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
after initialize => sub{ |
14
|
|
|
|
|
|
|
my ($class) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $factory = $class->factory(); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$factory->does_caching( 1 ); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return; |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has connector => ( |
24
|
|
|
|
|
|
|
is => 'lazy', |
25
|
|
|
|
|
|
|
isa => InstanceOf[ 'DBIx::Connector' ], |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _build_connector { |
29
|
4
|
|
|
4
|
|
18213
|
my ($self) = @_; |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
26
|
my $dsn = $self->dsn(); |
32
|
4
|
100
|
|
|
|
1499
|
my $username = $self->can('username') ? $self->username() : ''; |
33
|
4
|
100
|
|
|
|
141
|
my $password = $self->can('password') ? $self->password() : ''; |
34
|
4
|
100
|
|
|
|
1570
|
my $attributes = $self->can('attributes') ? $self->attributes() : {}; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
46
|
return DBIx::Connector->new( |
37
|
|
|
|
|
|
|
$dsn, |
38
|
|
|
|
|
|
|
$username, |
39
|
|
|
|
|
|
|
$password, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
AutoCommit => 1, |
42
|
|
|
|
|
|
|
%$attributes, |
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |