File Coverage

blib/lib/SQL/SqlObject/ODBC.pm
Criterion Covered Total %
statement 13 22 59.0
branch 0 4 0.0
condition n/a
subroutine 5 6 83.3
pod n/a
total 18 32 56.2


line stmt bran cond sub pod time code
1             package SQL::SqlObject::ODBC;
2            
3 1     1   6708 use strict;
  1         2  
  1         41  
4 1     1   6 use warnings;
  1         2  
  1         32  
5 1     1   678 use SQL::SqlObject;
  1         75  
  1         43  
6 1     1   13 use base 'SQL::SqlObject';
  1         2  
  1         510  
7            
8             # additional/redefined args
9             SQL::SqlObject::Config::set DSN => 'dbi:ODBC';
10             #SQL::SqlObject::Config::set NAME_PREFIX => '';
11            
12             # initilization ruitine
13 1     1   4 sub _init { shift->db_name_prefix = '' }
14            
15             # overload the hash quoting mechinism.
16             # -ODBC wants it's numeric values quoted. (ECE)
17             sub _sql_quote_hash
18             {
19 0 0   0     Carp::confess "sql_quote_hash: No hash ref specified" unless @_ > 1;
20 0           my ($self, $href) = @_;
21 0           while ( my ($k,$v) = each %$href) {
22 0           $v =~ s|^'||; # Remove initial and final quotes, just in case.
23 0           $v =~ s|'$||;
24 0           $v =~ s|'|''|g; # Double the single-quotes in the string
25 0           $v =~ s|"|""|g; # Double the double-quotes in the string
26 0 0         $v = qq('$v') unless $v =~ /^null$/;
27 0           $href->{$k}=$v;
28             }
29             }
30            
31             1;
32             __END__