X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FODBC.pm;h=1a21f3d6dda2e779e65ae096ee48f3241cd972a5;hb=ca7feebf8b6e7c50fe330f505ea5e9056a407f59;hp=b4cdec3e38318693da998a26e5fbff1673f91d9c;hpb=995edf3f035cbd35082df6d41230e84472ba4270;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 b4cdec3..1a21f3d 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -6,21 +6,58 @@ use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.04999_06'; +our $VERSION = '0.05000'; + +=head1 NAME + +DBIx::Class::Schema::Loader::DBI::ODBC - L proxy, currently only for +Microsoft SQL Server + +=head1 DESCRIPTION + +Reblesses into L, +which is a proxy for L when using the +L driver with Microsoft SQL Server. + +Code stolen from the L ODBC storage. + +See L for usage information. + +=cut sub _rebless { my $self = shift; my $dbh = $self->schema->storage->dbh; -# stolen from DBIC ODBC driver for MSSQL +# 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}"; - eval "require $class"; - bless $self, $class unless $@; + if ($self->load_optional_class($class) && !$self->isa($class)) { + bless $self, $class; + $self->_rebless; + } } } +=head1 SEE ALSO + +L, +L, +L, L, +L + +=head1 AUTHOR + +See L and L. + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. + +=cut + 1;