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