1 package DBIx::Class::Storage::DBI::ODBC;
4 use base qw/DBIx::Class::Storage::DBI/;
7 sub _rebless { shift->_determine_connector_driver('ODBC') }
9 # Whether or not we are connecting via the freetds ODBC driver
13 my $dsn = $self->_dbi_connect_info->[0];
16 ( (! ref $dsn) and $dsn =~ /driver=FreeTDS/i)
18 ( ($self->_dbh_get_info('SQL_DRIVER_NAME')||'') =~ /tdsodbc/i )
24 # Either returns the FreeTDS version via which we are connecting, 0 if can't
25 # be determined, or undef otherwise
26 sub _using_freetds_version {
28 return undef unless $self->_using_freetds;
29 return $self->_dbh_get_info('SQL_DRIVER_VER') || 0;
32 sub _disable_odbc_array_ops {
34 my $dbh = $self->_get_dbh;
36 if (eval { DBD::ODBC->VERSION(1.35_01) }) {
37 $dbh->{odbc_array_operations} = 0;
39 elsif (eval { DBD::ODBC->VERSION(1.33_01) }) {
40 $dbh->{odbc_disable_array_operations} = 1;
48 DBIx::Class::Storage::DBI::ODBC - Base class for ODBC drivers
52 This class simply provides a mechanism for discovering and loading a sub-class
53 for a specific ODBC backend. It should be transparent to the user.
57 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
61 You may distribute this code under the same terms as Perl itself.