line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer2::Plugin::Pg; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
13164
|
use Dancer2::Plugin; |
|
1
|
|
|
|
|
65170
|
|
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
527
|
use Dancer2::Plugin::Pg::Core; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
113
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
register Pg => sub { |
9
|
|
|
|
|
|
|
my $dsl = shift; |
10
|
|
|
|
|
|
|
my $connection = shift; |
11
|
|
|
|
|
|
|
my $conf; |
12
|
|
|
|
|
|
|
if($connection) { |
13
|
|
|
|
|
|
|
$conf = plugin_setting()->{connections}->{$connection}; |
14
|
|
|
|
|
|
|
}else{ |
15
|
|
|
|
|
|
|
if (plugin_setting()->{connections}->{default}) { |
16
|
|
|
|
|
|
|
$conf = plugin_setting()->{connections}->{default}; |
17
|
|
|
|
|
|
|
}else{ |
18
|
|
|
|
|
|
|
$conf = plugin_setting(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
return Dancer2::Plugin::Pg::Core->new($conf); |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
register_plugin; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |