Commit | Line | Data |
2a57124d |
1 | package DBIx::Class::Storage::DBI::ODBC; |
2 | use strict; |
3 | use warnings; |
4 | |
5 | use base qw/DBIx::Class::Storage::DBI/; |
2ad62d97 |
6 | use mro 'c3'; |
ed7ab0f4 |
7 | use Try::Tiny; |
2a57124d |
8 | |
9 | sub _rebless { |
52b420dd |
10 | my ($self) = @_; |
11 | |
12 | try { |
13 | my $dbtype = $self->_get_dbh->get_info(17); |
14 | |
15 | # Translate the backend name into a perl identifier |
16 | $dbtype =~ s/\W/_/gi; |
17 | my $subclass = "DBIx::Class::Storage::DBI::ODBC::${dbtype}"; |
18 | |
19 | if ($self->load_optional_class($subclass) && !$self->isa($subclass)) { |
20 | bless $self, $subclass; |
21 | $self->_rebless; |
2a57124d |
22 | } |
52b420dd |
23 | }; |
2a57124d |
24 | } |
25 | |
2a57124d |
26 | 1; |
27 | |
28 | =head1 NAME |
29 | |
30 | DBIx::Class::Storage::DBI::ODBC - Base class for ODBC drivers |
31 | |
2a57124d |
32 | =head1 DESCRIPTION |
33 | |
34 | This class simply provides a mechanism for discovering and loading a sub-class |
35 | for a specific ODBC backend. It should be transparent to the user. |
36 | |
2a57124d |
37 | =head1 AUTHORS |
38 | |
c1e64353 |
39 | Marc Mims C<< <marc@questright.com> >> |
2a57124d |
40 | |
41 | =head1 LICENSE |
42 | |
43 | You may distribute this code under the same terms as Perl itself. |
44 | |
45 | =cut |