line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MojoX::Mysql::Util; |
2
|
7
|
|
|
7
|
|
23
|
use Mojo::Base -base; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
35
|
|
3
|
7
|
|
|
7
|
|
706
|
use Mojo::Util qw(dumper); |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
240
|
|
4
|
7
|
|
|
7
|
|
22
|
use Mojo::Collection 'c'; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
1726
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub quote { |
7
|
3
|
|
|
3
|
0
|
20
|
my ($self,$str,$default) = @_; |
8
|
3
|
|
100
|
|
|
10
|
$default ||= 'DEFAULT'; |
9
|
3
|
100
|
|
|
|
6
|
if($str){ |
10
|
1
|
|
|
|
|
8
|
$str =~ s/['\\]/\\$&/gmo; |
11
|
1
|
|
|
|
|
8
|
return qq{'$str'}; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
else{ |
14
|
2
|
|
|
|
|
8
|
return $default; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub quote_in { |
19
|
0
|
|
|
0
|
0
|
0
|
my ($self,$obj,$default) = @_; |
20
|
0
|
0
|
|
|
|
0
|
if(ref $obj eq 'ARRAY'){ |
21
|
0
|
|
|
|
|
0
|
return join(",",map($self->quote($_,$default),@{$obj})); |
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else{ |
24
|
0
|
|
|
|
|
0
|
return $self->quote($obj,$default); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub id { |
29
|
1
|
|
|
1
|
0
|
6
|
my ($self) = @_; |
30
|
1
|
|
|
|
|
2
|
my @keys = sort {$a <=> $b} grep($_ ne '_default',keys %{$self->{'config'}}); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
11
|
|
31
|
1
|
|
|
|
|
7
|
return c(@keys); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |