X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FODBC.pm;h=d67103bdc05c4b74bb7a1dfd499800f03d2149cf;hb=188038c0d8bf2df07b728e070bee4ca5d2de3026;hp=2d53091aae877d7ecf602882de6ab95b4b7c12aa;hpb=9cc8e7e177103e568c99f968ff848d25e6c3bea8;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm index 2d53091..d67103b 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -3,21 +3,17 @@ package DBIx::Class::Schema::Loader::DBI::ODBC; use strict; use warnings; use base 'DBIx::Class::Schema::Loader::DBI'; -use Carp::Clan qw/^DBIx::Class/; -use Class::C3; +use mro 'c3'; -our $VERSION = '0.04999_12'; +our $VERSION = '0.07048'; =head1 NAME -DBIx::Class::Schema::Loader::DBI::ODBC - L proxy, currently only for -Microsoft SQL Server +DBIx::Class::Schema::Loader::DBI::ODBC - L proxy =head1 DESCRIPTION -Reblesses into L, -which is a proxy for L when using the -L driver with Microsoft SQL Server. +Reblesses into an C<::ODBC::> class when connecting via L. Code stolen from the L ODBC storage. @@ -26,32 +22,35 @@ See L for usage information. =cut sub _rebless { - my $self = shift; - my $dbh = $self->schema->storage->dbh; - -# stolen from DBIC ODBC storage - my $dbtype = eval { $dbh->get_info(17) }; - unless ( $@ ) { - # Translate the backend name into a perl identifier - $dbtype =~ s/\W/_/gi; - my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}"; - if ($self->load_optional_class($class) && !$self->isa($class)) { - bless $self, $class; - $self->_rebless; + my $self = shift; + + return if ref $self ne __PACKAGE__; + + # stolen from DBIC ODBC storage + my $dbh = $self->schema->storage->dbh; + my $dbtype = eval { $dbh->get_info(17) }; + unless ( $@ ) { + # Translate the backend name into a perl identifier + $dbtype =~ s/\W/_/gi; + my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}"; + if ($self->load_optional_class($class) && !$self->isa($class)) { + bless $self, $class; + $self->_rebless; + } } - } } =head1 SEE ALSO L, -L, +L, +L, L, L, L -=head1 AUTHOR +=head1 AUTHORS -See L and L. +See L. =head1 LICENSE