line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Aniki::QueryBuilder::Canonical; |
2
|
28
|
|
|
28
|
|
69910
|
use 5.014002; |
|
28
|
|
|
|
|
122
|
|
3
|
|
|
|
|
|
|
|
4
|
28
|
|
|
28
|
|
181
|
use strict; |
|
28
|
|
|
|
|
72
|
|
|
28
|
|
|
|
|
577
|
|
5
|
28
|
|
|
28
|
|
153
|
use warnings; |
|
28
|
|
|
|
|
71
|
|
|
28
|
|
|
|
|
811
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
749
|
use parent qw/Aniki::QueryBuilder/; |
|
28
|
|
|
|
|
523
|
|
|
28
|
|
|
|
|
207
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub insert { |
10
|
1066
|
|
|
1066
|
1
|
281403
|
my ($self, $table, $values, $opt) = @_; |
11
|
1066
|
50
|
|
|
|
3158
|
if (ref $values eq 'HASH') { |
12
|
|
|
|
|
|
|
$values = [ |
13
|
1066
|
|
|
|
|
3705
|
map { $_ => $values->{$_} } sort keys %$values |
|
2095
|
|
|
|
|
4879
|
|
14
|
|
|
|
|
|
|
]; |
15
|
|
|
|
|
|
|
} |
16
|
1066
|
|
|
|
|
3535
|
return $self->SUPER::insert($table, $values, $opt); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub update { |
20
|
1008
|
|
|
1008
|
1
|
438095
|
my ($self, $table, $args, $where) = @_; |
21
|
1008
|
50
|
|
|
|
3004
|
if (ref $args eq 'HASH') { |
22
|
|
|
|
|
|
|
$args = [ |
23
|
1008
|
|
|
|
|
3714
|
map { $_ => $args->{$_} } sort keys %$args |
|
2010
|
|
|
|
|
4994
|
|
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
} |
26
|
1008
|
50
|
|
|
|
2956
|
if (ref $where eq 'HASH') { |
27
|
|
|
|
|
|
|
$where = [ |
28
|
1008
|
|
|
|
|
2638
|
map { $_ => $where->{$_} } sort keys %$where |
|
2008
|
|
|
|
|
4356
|
|
29
|
|
|
|
|
|
|
]; |
30
|
|
|
|
|
|
|
} |
31
|
1008
|
|
|
|
|
3493
|
return $self->SUPER::update($table, $args, $where); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub delete :method { |
35
|
1002
|
|
|
1002
|
1
|
302670
|
my ($self, $table, $where, $opt) = @_; |
36
|
1002
|
50
|
|
|
|
2586
|
if (ref $where eq 'HASH') { |
37
|
|
|
|
|
|
|
$where = [ |
38
|
1002
|
|
|
|
|
3318
|
map { $_ => $where->{$_} } sort keys %$where |
|
2002
|
|
|
|
|
4272
|
|
39
|
|
|
|
|
|
|
]; |
40
|
|
|
|
|
|
|
} |
41
|
1002
|
|
|
|
|
3117
|
return $self->SUPER::delete($table, $where, $opt); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub select_query { |
45
|
1079
|
|
|
1079
|
0
|
465794
|
my ($self, $table, $fields, $where, $opt) = @_; |
46
|
1079
|
50
|
|
|
|
3023
|
if (ref $where eq 'HASH') { |
47
|
|
|
|
|
|
|
$where = [ |
48
|
1079
|
|
|
|
|
3661
|
map { $_ => $where->{$_} } sort keys %$where |
|
2055
|
|
|
|
|
4610
|
|
49
|
|
|
|
|
|
|
]; |
50
|
|
|
|
|
|
|
} |
51
|
1079
|
|
|
|
|
3395
|
return $self->SUPER::select_query($table, $fields, $where, $opt); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__END__ |