line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Aniki::QueryBuilder::Canonical; |
2
|
28
|
|
|
28
|
|
48957
|
use 5.014002; |
|
28
|
|
|
|
|
100
|
|
3
|
|
|
|
|
|
|
|
4
|
28
|
|
|
28
|
|
148
|
use strict; |
|
28
|
|
|
|
|
61
|
|
|
28
|
|
|
|
|
494
|
|
5
|
28
|
|
|
28
|
|
130
|
use warnings; |
|
28
|
|
|
|
|
57
|
|
|
28
|
|
|
|
|
806
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
490
|
use parent qw/Aniki::QueryBuilder/; |
|
28
|
|
|
|
|
279
|
|
|
28
|
|
|
|
|
165
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub insert { |
10
|
1067
|
|
|
1067
|
1
|
283379
|
my ($self, $table, $values, $opt) = @_; |
11
|
1067
|
50
|
|
|
|
3383
|
if (ref $values eq 'HASH') { |
12
|
|
|
|
|
|
|
$values = [ |
13
|
1067
|
|
|
|
|
3667
|
map { $_ => $values->{$_} } sort keys %$values |
|
2096
|
|
|
|
|
5064
|
|
14
|
|
|
|
|
|
|
]; |
15
|
|
|
|
|
|
|
} |
16
|
1067
|
|
|
|
|
3374
|
return $self->SUPER::insert($table, $values, $opt); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub update { |
20
|
1008
|
|
|
1008
|
1
|
388284
|
my ($self, $table, $args, $where) = @_; |
21
|
1008
|
50
|
|
|
|
2577
|
if (ref $args eq 'HASH') { |
22
|
|
|
|
|
|
|
$args = [ |
23
|
1008
|
|
|
|
|
3301
|
map { $_ => $args->{$_} } sort keys %$args |
|
2010
|
|
|
|
|
4437
|
|
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
} |
26
|
1008
|
50
|
|
|
|
2643
|
if (ref $where eq 'HASH') { |
27
|
|
|
|
|
|
|
$where = [ |
28
|
1008
|
|
|
|
|
2499
|
map { $_ => $where->{$_} } sort keys %$where |
|
2008
|
|
|
|
|
3864
|
|
29
|
|
|
|
|
|
|
]; |
30
|
|
|
|
|
|
|
} |
31
|
1008
|
|
|
|
|
2942
|
return $self->SUPER::update($table, $args, $where); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub delete :method { |
35
|
1002
|
|
|
1002
|
1
|
308282
|
my ($self, $table, $where, $opt) = @_; |
36
|
1002
|
50
|
|
|
|
2484
|
if (ref $where eq 'HASH') { |
37
|
|
|
|
|
|
|
$where = [ |
38
|
1002
|
|
|
|
|
3300
|
map { $_ => $where->{$_} } sort keys %$where |
|
2002
|
|
|
|
|
4478
|
|
39
|
|
|
|
|
|
|
]; |
40
|
|
|
|
|
|
|
} |
41
|
1002
|
|
|
|
|
2912
|
return $self->SUPER::delete($table, $where, $opt); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub select_query { |
45
|
1084
|
|
|
1084
|
0
|
476396
|
my ($self, $table, $fields, $where, $opt) = @_; |
46
|
1084
|
50
|
|
|
|
3036
|
if (ref $where eq 'HASH') { |
47
|
|
|
|
|
|
|
$where = [ |
48
|
1084
|
|
|
|
|
3696
|
map { $_ => $where->{$_} } sort keys %$where |
|
2060
|
|
|
|
|
4768
|
|
49
|
|
|
|
|
|
|
]; |
50
|
|
|
|
|
|
|
} |
51
|
1084
|
|
|
|
|
3375
|
return $self->SUPER::select_query($table, $fields, $where, $opt); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__END__ |