• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.9.5/CPANInternal-140/DBIx-Class-Schema-Loader-0.07033/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 mro 'c3';
7
8our $VERSION = '0.07033';
9
10=head1 NAME
11
12DBIx::Class::Schema::Loader::DBI::ODBC - L<DBD::ODBC> proxy
13
14=head1 DESCRIPTION
15
16Reblesses into an C<::ODBC::> class when connecting via L<DBD::ODBC>.
17
18Code stolen from the L<DBIx::Class> ODBC storage.
19
20See L<DBIx::Class::Schema::Loader::Base> for usage information.
21
22=cut
23
24sub _rebless {
25  my $self = shift;
26
27  return if ref $self ne __PACKAGE__;
28
29# stolen from DBIC ODBC storage
30  my $dbh  = $self->schema->storage->dbh;
31  my $dbtype = eval { $dbh->get_info(17) };
32  unless ( $@ ) {
33    # Translate the backend name into a perl identifier
34    $dbtype =~ s/\W/_/gi;
35    my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}";
36    if ($self->load_optional_class($class) && !$self->isa($class)) {
37        bless $self, $class;
38        $self->_rebless;
39    }
40  }
41}
42
43sub _tables_list {
44    my ($self, $opts) = @_;
45
46    return $self->next::method($opts, undef, undef);
47}
48
49=head1 SEE ALSO
50
51L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>,
52L<DBIx::Class::Schema::Loader::DBI::ODBC::SQL_Anywhere>,
53L<DBIx::Class::Schema::Loader::DBI::ODBC::Firebird>,
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