| 1 | 1 | ▶ | use 5.014; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
| |||||||||||
| 5 | 1 | ▶ | unless ($ENV{DBO_ALLOW_DBM}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 6 | 1 | warn "Set \$ENV{DBO_ALLOW_DBM} to a true value to try DBM.\n"; | |||||||||
| 7 | 1 | 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, $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; | ||||||||||