line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Aniki::QueryBuilder::Canonical; |
2
|
28
|
|
|
28
|
|
54509
|
use 5.014002; |
|
28
|
|
|
|
|
122
|
|
3
|
|
|
|
|
|
|
|
4
|
28
|
|
|
28
|
|
169
|
use strict; |
|
28
|
|
|
|
|
70
|
|
|
28
|
|
|
|
|
616
|
|
5
|
28
|
|
|
28
|
|
147
|
use warnings; |
|
28
|
|
|
|
|
72
|
|
|
28
|
|
|
|
|
943
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
572
|
use parent qw/Aniki::QueryBuilder/; |
|
28
|
|
|
|
|
302
|
|
|
28
|
|
|
|
|
222
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub insert { |
10
|
1066
|
|
|
1066
|
1
|
282194
|
my ($self, $table, $values, $opt) = @_; |
11
|
1066
|
50
|
|
|
|
3009
|
if (ref $values eq 'HASH') { |
12
|
|
|
|
|
|
|
$values = [ |
13
|
1066
|
|
|
|
|
3749
|
map { $_ => $values->{$_} } sort keys %$values |
|
2095
|
|
|
|
|
5308
|
|
14
|
|
|
|
|
|
|
]; |
15
|
|
|
|
|
|
|
} |
16
|
1066
|
|
|
|
|
3524
|
return $self->SUPER::insert($table, $values, $opt); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub update { |
20
|
1008
|
|
|
1008
|
1
|
445981
|
my ($self, $table, $args, $where) = @_; |
21
|
1008
|
50
|
|
|
|
2965
|
if (ref $args eq 'HASH') { |
22
|
|
|
|
|
|
|
$args = [ |
23
|
1008
|
|
|
|
|
3766
|
map { $_ => $args->{$_} } sort keys %$args |
|
2010
|
|
|
|
|
5059
|
|
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
} |
26
|
1008
|
50
|
|
|
|
2912
|
if (ref $where eq 'HASH') { |
27
|
|
|
|
|
|
|
$where = [ |
28
|
1008
|
|
|
|
|
2753
|
map { $_ => $where->{$_} } sort keys %$where |
|
2008
|
|
|
|
|
4377
|
|
29
|
|
|
|
|
|
|
]; |
30
|
|
|
|
|
|
|
} |
31
|
1008
|
|
|
|
|
3500
|
return $self->SUPER::update($table, $args, $where); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub delete :method { |
35
|
1002
|
|
|
1002
|
1
|
311178
|
my ($self, $table, $where, $opt) = @_; |
36
|
1002
|
50
|
|
|
|
2710
|
if (ref $where eq 'HASH') { |
37
|
|
|
|
|
|
|
$where = [ |
38
|
1002
|
|
|
|
|
3424
|
map { $_ => $where->{$_} } sort keys %$where |
|
2002
|
|
|
|
|
4610
|
|
39
|
|
|
|
|
|
|
]; |
40
|
|
|
|
|
|
|
} |
41
|
1002
|
|
|
|
|
3111
|
return $self->SUPER::delete($table, $where, $opt); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub select_query { |
45
|
1079
|
|
|
1079
|
0
|
487512
|
my ($self, $table, $fields, $where, $opt) = @_; |
46
|
1079
|
50
|
|
|
|
3077
|
if (ref $where eq 'HASH') { |
47
|
|
|
|
|
|
|
$where = [ |
48
|
1079
|
|
|
|
|
3924
|
map { $_ => $where->{$_} } sort keys %$where |
|
2055
|
|
|
|
|
4990
|
|
49
|
|
|
|
|
|
|
]; |
50
|
|
|
|
|
|
|
} |
51
|
1079
|
|
|
|
|
3503
|
return $self->SUPER::select_query($table, $fields, $where, $opt); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__END__ |