Commit | Line | Data |
995edf3f |
1 | package DBIx::Class::Schema::Loader::DBI::ODBC; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use base 'DBIx::Class::Schema::Loader::DBI'; |
6 | use Carp::Clan qw/^DBIx::Class/; |
7 | use Class::C3; |
8 | |
9 | our $VERSION = '0.04999_06'; |
10 | |
e57fd726 |
11 | =head1 NAME |
12 | |
13 | DBIx::Class::Schema::Loader::DBI::ODBC - L<DBD::ODBC> proxy, currently only for |
14 | Microsoft SQL Server |
15 | |
16 | =head1 DESCRIPTION |
17 | |
18 | Reblesses into L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>, |
19 | which is a proxy for L<DBIx::Class::Schema::Loader::DBI::MSSQL> when using the |
20 | L<DBD::ODBC> driver with Microsoft SQL Server. |
21 | |
22 | Code stolen from the L<DBIx::Class> ODBC storage. |
23 | |
24 | See L<DBIx::Class::Schema::Loader::Base> for usage information. |
25 | |
26 | =cut |
27 | |
995edf3f |
28 | sub _rebless { |
29 | my $self = shift; |
30 | my $dbh = $self->schema->storage->dbh; |
31 | |
e57fd726 |
32 | # stolen from DBIC ODBC storage |
995edf3f |
33 | my $dbtype = eval { $dbh->get_info(17) }; |
34 | unless ( $@ ) { |
35 | # Translate the backend name into a perl identifier |
36 | $dbtype =~ s/\W/_/gi; |
37 | my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}"; |
1abbac9a |
38 | eval { $self->ensure_class_loaded($class) }; |
995edf3f |
39 | bless $self, $class unless $@; |
40 | } |
41 | } |
42 | |
e57fd726 |
43 | =head1 SEE ALSO |
44 | |
45 | L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>, |
46 | L<DBIx::Class::Schema::Loader::DBI::MSSQL>, |
47 | L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>, |
48 | L<DBIx::Class::Schema::Loader::DBI> |
49 | |
50 | =head1 AUTHOR |
51 | |
52 | Rafael Kitover C<rkitover@cpan.org> |
53 | |
54 | =cut |
55 | |
995edf3f |
56 | 1; |