| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
39
|
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
65
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
BEGIN { |
|
5
|
1
|
50
|
|
1
|
|
5
|
unless ($ENV{DBO_ALLOW_DBM}) { |
|
6
|
1
|
|
|
|
|
55
|
warn "Set \$ENV{DBO_ALLOW_DBM} to a true value to try DBM.\n"; |
|
7
|
1
|
|
|
|
|
33
|
die "DBM is not yet supported!\n"; |
|
8
|
|
|
|
|
|
|
} |
|
9
|
|
|
|
|
|
|
} |
|
10
|
|
|
|
|
|
|
use SQL::Statement; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package # hide from PAUSE |
|
13
|
|
|
|
|
|
|
DBIx::DBO::DBD::DBM; |
|
14
|
|
|
|
|
|
|
use Carp 'croak'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _init_dbo { |
|
17
|
|
|
|
|
|
|
my $class = shift; |
|
18
|
|
|
|
|
|
|
my $me = $class->SUPER::_init_dbo(@_); |
|
19
|
|
|
|
|
|
|
# DBM does not support QuoteIdentifier correctly! |
|
20
|
|
|
|
|
|
|
$me->config(QuoteIdentifier => 0); |
|
21
|
|
|
|
|
|
|
return $me; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _get_table_schema { |
|
25
|
|
|
|
|
|
|
# Schema is not used |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _get_column_info { |
|
29
|
|
|
|
|
|
|
my($class, $me, $schema, $table) = @_; |
|
30
|
|
|
|
|
|
|
my $q_table = $table; |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
unless (exists $me->rdbh->{dbm_tables}{$q_table}) { |
|
33
|
|
|
|
|
|
|
$q_table = $class->_qi($me, $table); # Try with the quoted table name |
|
34
|
|
|
|
|
|
|
unless (exists $me->rdbh->{dbm_tables}{$q_table}) { |
|
35
|
|
|
|
|
|
|
croak 'Invalid table: '.$q_table; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
# The DBM internal table_name may be different. |
|
39
|
|
|
|
|
|
|
$q_table = $me->rdbh->{dbm_tables}{$q_table}{table_name}; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
unless (exists $me->rdbh->{f_meta}{$q_table} |
|
42
|
|
|
|
|
|
|
and exists $me->rdbh->{f_meta}{$q_table}{col_names} |
|
43
|
|
|
|
|
|
|
and ref $me->rdbh->{f_meta}{$q_table}{col_names} eq 'ARRAY') { |
|
44
|
|
|
|
|
|
|
croak 'Invalid DBM table info, could be an incompatible version'; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
my $cols = $me->rdbh->{f_meta}{$q_table}{col_names}; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $i; |
|
49
|
|
|
|
|
|
|
map { $_ => ++$i } @$cols; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _set_table_key_info { |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |