File Coverage

blib/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm
Criterion Covered Total %
statement 12 23 52.1
branch 0 6 0.0
condition 0 3 0.0
subroutine 4 5 80.0
pod n/a
total 16 37 43.2


line stmt bran cond sub pod time code
1             package DBIx::Class::Schema::Loader::DBI::ODBC;
2              
3 1     1   9 use strict;
  1         2  
  1         31  
4 1     1   5 use warnings;
  1         2  
  1         25  
5 1     1   6 use base 'DBIx::Class::Schema::Loader::DBI';
  1         2  
  1         562  
6 1     1   9 use mro 'c3';
  1         4  
  1         9  
7              
8             our $VERSION = '0.07050';
9              
10             =head1 NAME
11              
12             DBIx::Class::Schema::Loader::DBI::ODBC - L proxy
13              
14             =head1 DESCRIPTION
15              
16             Reblesses into an C<::ODBC::> class when connecting via L.
17              
18             Code stolen from the L ODBC storage.
19              
20             See L for usage information.
21              
22             =cut
23              
24             sub _rebless {
25 0     0     my $self = shift;
26              
27 0 0         return if ref $self ne __PACKAGE__;
28              
29             # stolen from DBIC ODBC storage
30 0           my $dbh = $self->schema->storage->dbh;
31 0           my $dbtype = eval { $dbh->get_info(17) };
  0            
32 0 0         unless ( $@ ) {
33             # Translate the backend name into a perl identifier
34 0           $dbtype =~ s/\W/_/gi;
35 0           my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}";
36 0 0 0       if ($self->load_optional_class($class) && !$self->isa($class)) {
37 0           bless $self, $class;
38 0           $self->_rebless;
39             }
40             }
41             }
42              
43             =head1 SEE ALSO
44              
45             L,
46             L,
47             L,
48             L, L,
49             L
50              
51             =head1 AUTHORS
52              
53             See L.
54              
55             =head1 LICENSE
56              
57             This library is free software; you can redistribute it and/or modify it under
58             the same terms as Perl itself.
59              
60             =cut
61              
62             1;