line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
package DBIx::DataModel::Schema::ResultAs::Flat_arrayref; |
3
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
4
|
3
|
|
|
3
|
|
1944
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
97
|
|
5
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
79
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
13
|
use parent 'DBIx::DataModel::Schema::ResultAs'; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
15
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
142
|
use namespace::clean; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
20
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_result { |
12
|
6
|
|
|
6
|
1
|
18
|
my ($self, $statement) = @_; |
13
|
|
|
|
|
|
|
|
14
|
6
|
|
|
|
|
22
|
$statement->execute; |
15
|
6
|
|
|
|
|
19
|
$statement->make_fast; |
16
|
6
|
|
|
|
|
14
|
my @vals; |
17
|
6
|
|
|
|
|
16
|
my @headers = $statement->headers; |
18
|
6
|
|
|
|
|
118
|
while (my $row = $statement->next) { |
19
|
13
|
|
|
|
|
24
|
push @vals, @{$row}{@headers}; |
|
13
|
|
|
|
|
37
|
|
20
|
|
|
|
|
|
|
} |
21
|
6
|
|
|
|
|
19
|
$statement->finish; |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
172
|
return \@vals; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# THINK : should we take a list of columns as arguments, |
27
|
|
|
|
|
|
|
# i.e. -result_as => [flat_arrayref => ($col1, ...)], instead of taking |
28
|
|
|
|
|
|
|
# ->headers ? Easy to implement, but it wouldn't really make sense, |
29
|
|
|
|
|
|
|
# because the choice of columns is done in the -columns arg to |
30
|
|
|
|
|
|
|
# select(). |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |