line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hide from PAUSE |
2
|
|
|
|
|
|
|
DBIx::Class::Admin::Types; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# Workaround for https://rt.cpan.org/Public/Bug/Display.html?id=83336 |
5
|
2
|
|
|
2
|
|
2693
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
6
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
|
|
|
use MooseX::Types -declare => [qw( |
9
|
|
|
|
|
|
|
DBICConnectInfo |
10
|
|
|
|
|
|
|
DBICArrayRef |
11
|
|
|
|
|
|
|
DBICHashRef |
12
|
2
|
|
|
2
|
|
141
|
)]; |
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use MooseX::Types::Moose qw/Int HashRef ArrayRef Str Any Bool/; |
14
|
|
|
|
|
|
|
use MooseX::Types::JSON qw(JSON); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
subtype DBICArrayRef, |
17
|
|
|
|
|
|
|
as ArrayRef; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
subtype DBICHashRef, |
20
|
|
|
|
|
|
|
as HashRef; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
coerce DBICArrayRef, |
23
|
|
|
|
|
|
|
from JSON, |
24
|
|
|
|
|
|
|
via { _json_to_data ($_) }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
coerce DBICHashRef, |
27
|
|
|
|
|
|
|
from JSON, |
28
|
|
|
|
|
|
|
via { _json_to_data($_) }; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
subtype DBICConnectInfo, |
31
|
|
|
|
|
|
|
as ArrayRef; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
coerce DBICConnectInfo, |
34
|
|
|
|
|
|
|
from JSON, |
35
|
|
|
|
|
|
|
via { return _json_to_data($_) } ; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
coerce DBICConnectInfo, |
38
|
|
|
|
|
|
|
from Str, |
39
|
|
|
|
|
|
|
via { return _json_to_data($_) }; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
coerce DBICConnectInfo, |
42
|
|
|
|
|
|
|
from HashRef, |
43
|
|
|
|
|
|
|
via { [ $_ ] }; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _json_to_data { |
46
|
|
|
|
|
|
|
my ($json_str) = @_; |
47
|
|
|
|
|
|
|
my $json = JSON::Any->new(allow_barekey => 1, allow_singlequote => 1, relaxed=>1); |
48
|
|
|
|
|
|
|
my $ret = $json->jsonToObj($json_str); |
49
|
|
|
|
|
|
|
return $ret; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |