ODBC fixes: superfluous connection in rebless; undef PK on first insert in MSSQL
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / ODBC.pm
CommitLineData
2a57124d 1package DBIx::Class::Storage::DBI::ODBC;
2use strict;
3use warnings;
4
5use base qw/DBIx::Class::Storage::DBI/;
6
7sub _rebless {
8 my ($self) = @_;
9
2eebd801 10 my $dbtype = eval { $self->_dbh->get_info(17) };
2a57124d 11 unless ( $@ ) {
12 # Translate the backend name into a perl identifier
13 $dbtype =~ s/\W/_/gi;
14 my $class = "DBIx::Class::Storage::DBI::ODBC::${dbtype}";
15 eval "require $class";
16 bless $self, $class unless $@;
17 }
18}
19
20
211;
22
23=head1 NAME
24
25DBIx::Class::Storage::DBI::ODBC - Base class for ODBC drivers
26
27=head1 SYNOPSIS
28
29 # In your table classes
30 __PACKAGE__->load_components(qw/Core/);
31
32
33=head1 DESCRIPTION
34
35This class simply provides a mechanism for discovering and loading a sub-class
36for a specific ODBC backend. It should be transparent to the user.
37
38
39=head1 AUTHORS
40
c1e64353 41Marc Mims C<< <marc@questright.com> >>
2a57124d 42
43=head1 LICENSE
44
45You may distribute this code under the same terms as Perl itself.
46
47=cut