line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ActiveRecord::Simple::QueryManager; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
4320
|
use ActiveRecord::Simple::Find; |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
2497
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
12
|
|
|
12
|
0
|
40
|
sub new { bless {}, shift } |
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
1
|
0
|
sub all { ActiveRecord::Simple::Find->new(shift->{caller})->fetch } |
9
|
20
|
|
|
20
|
1
|
73
|
sub get { ActiveRecord::Simple::Find->new(shift->{caller}, @_)->fetch } |
10
|
52
|
|
|
52
|
1
|
168
|
sub find { ActiveRecord::Simple::Find->new(shift->{caller}, @_) } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub sql_fetch_all { |
13
|
1
|
|
|
1
|
1
|
3
|
my ($self, $sql, @bind) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
my $data = $self->{caller}->dbh->selectall_arrayref($sql, { Slice => {} }, @bind); |
16
|
1
|
|
|
|
|
118
|
my @list; |
17
|
1
|
|
|
|
|
3
|
for my $row (@$data) { |
18
|
1
|
|
|
|
|
9
|
$self->{caller}->_mk_ro_accessors([keys %$row]); |
19
|
1
|
|
|
|
|
3
|
bless $row, $self->{caller}; |
20
|
1
|
|
|
|
|
3
|
push @list, $row; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
8
|
return \@list; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub sql_fetch_row { |
27
|
1
|
|
|
1
|
1
|
4
|
my ($self, $sql, @bind) = @_; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
3
|
my $row = $self->{caller}->dbh->selectrow_hashref($sql, undef, @bind); |
30
|
1
|
|
|
|
|
89
|
$self->{caller}->_mk_ro_accessors([keys %$row]); |
31
|
1
|
|
|
|
|
3
|
bless $row, $self->{caller}; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
6
|
return $row; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__; |