[Bast-commits] r6037 - in DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI: . Sybase

arcanez at dev.catalyst.perl.org arcanez at dev.catalyst.perl.org
Thu Apr 30 08:27:11 GMT 2009


Author: arcanez
Date: 2009-04-30 09:27:11 +0100 (Thu, 30 Apr 2009)
New Revision: 6037

Modified:
   DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase.pm
   DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm
Log:
jump to ::DBI::Sybase::MSSQL if we are using MSSQL through Sybase

Modified: DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm	2009-04-30 08:24:41 UTC (rev 6036)
+++ DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm	2009-04-30 08:27:11 UTC (rev 6037)
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use Class::C3;
-use base qw/DBIx::Class::Storage::DBI::MSSQL DBIx::Class::Storage::DBI::Sybase/;
+use base qw/DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server DBIx::Class::Storage::DBI::Sybase/;
 
 1;
 
@@ -29,6 +28,8 @@
 
 Brandon L Black <blblack at gmail.com>
 
+Justin Hunter <justin.d.hunter at gmail.com>
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.

Modified: DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-04-30 08:24:41 UTC (rev 6036)
+++ DBIx-Class/0.08/branches/sybase_mssql/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-04-30 08:27:11 UTC (rev 6037)
@@ -5,6 +5,20 @@
 
 use base qw/DBIx::Class::Storage::DBI::NoBindVars/;
 
+sub _rebless {
+    my $self = shift;
+
+    my $dbh = $self->schema->storage->dbh;
+    my $DBMS_VERSION = @{$dbh->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})}[2];
+    if ($DBMS_VERSION =~ /^Microsoft /i) {
+        my $subclass = 'DBIx::Class::Storage::DBI::Sybase::MSSQL'; 
+        if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
+            bless $self, $subclass;
+            $self->_rebless;
+        }
+    }
+}
+
 1;
 
 =head1 NAME
@@ -21,6 +35,8 @@
 
 Brandon L Black <blblack at gmail.com>
 
+Justin Hunter <justin.d.hunter at gmail.com>
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.




More information about the Bast-commits mailing list