• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.9.5/CPANInternal-140/DBIx-Class-Schema-Loader-0.05003/lib/DBIx/Class/Schema/Loader/DBI/
1package DBIx::Class::Schema::Loader::DBI::ODBC;
2
3use strict;
4use warnings;
5use base 'DBIx::Class::Schema::Loader::DBI';
6use Carp::Clan qw/^DBIx::Class/;
7use Class::C3;
8
9our $VERSION = '0.05003';
10
11=head1 NAME
12
13DBIx::Class::Schema::Loader::DBI::ODBC - L<DBD::ODBC> proxy
14
15=head1 DESCRIPTION
16
17Reblesses into an C<::ODBC::> class when connecting via L<DBD::ODBC>.
18
19Code stolen from the L<DBIx::Class> ODBC storage.
20
21See L<DBIx::Class::Schema::Loader::Base> for usage information.
22
23=cut
24
25sub _rebless {
26  my $self = shift;
27
28  return if ref $self ne __PACKAGE__;
29
30# stolen from DBIC ODBC storage
31  my $dbh  = $self->schema->storage->dbh;
32  my $dbtype = eval { $dbh->get_info(17) };
33  unless ( $@ ) {
34    # Translate the backend name into a perl identifier
35    $dbtype =~ s/\W/_/gi;
36    my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}";
37    if ($self->load_optional_class($class) && !$self->isa($class)) {
38        bless $self, $class;
39        $self->_rebless;
40    }
41  }
42}
43
44sub _tables_list {
45    my $self = shift;
46
47    return $self->next::method(undef, undef);
48}
49
50=head1 SEE ALSO
51
52L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>,
53L<DBIx::Class::Schema::Loader::DBI::MSSQL>,
54L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
55L<DBIx::Class::Schema::Loader::DBI>
56
57=head1 AUTHOR
58
59See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
60
61=head1 LICENSE
62
63This library is free software; you can redistribute it and/or modify it under
64the same terms as Perl itself.
65
66=cut
67
681;
69