use strict;
use warnings;
-use base qw/DBIx::Class::Storage::DBI::Sybase/;
+use base qw/DBIx::Class::Storage::DBI/;
sub last_insert_id {
my( $id ) = $_[0]->_dbh->selectrow_array('SELECT @@IDENTITY' );
=head1 SYNOPSIS
-This subclass supports MSSQL. As MSSQL is usually used via a
-differently-named DBD such as L<DBD::Sybase>, it does not get
-autodetected by DBD-type like the other drivers, and you will need to
-specify this storage driver manually, as in:
+This subclass supports MSSQL, and can in theory be used directly
+via the C<storage_type> mechanism:
$schema->storage_type('::DBI::MSSQL');
- $schema->connect_info('dbi:Sybase:....', ...);
+ $schema->connect_info('dbi:....', ...);
+
+However, as there is no L<DBD::MSSQL>, you will probably want to use
+one of the other DBD-specific MSSQL classes, such as
+L<DBIx::Class::Storage::DBI::Sybase::MSSQL>. These classes will
+merge this class with a DBD-specific class to obtain fully
+correct behavior for your scenario.
=head1 AUTHORS
=head1 SYNOPSIS
-This subclass supports L<DBD::Sybase>.
+This subclass supports L<DBD::Sybase> for real Sybase databases. If
+you are using an MSSQL database via L<DBD::Sybase>, see
+L<DBIx::Class::Storage::DBI::Sybase::MSSQL>.
=head1 AUTHORS
--- /dev/null
+package DBIx::Class::Storage::DBI::Sybase::MSSQL;
+
+use strict;
+use warnings;
+
+use base qw/DBIx::Class::Storage::DBI::MSSQL DBIx::Class::Storage::DBI::Sybase/;
+
+1;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::Sybase::MSSQL - Storage::DBI subclass for MSSQL via
+DBD::Sybase
+
+=head1 SYNOPSIS
+
+This subclass supports MSSQL connected via L<DBD::Sybase>.
+
+ $schema->storage_type('::DBI::Sybase::MSSQL');
+ $schema->connect_info('dbi:Sybase:....', ...);
+
+=head1 AUTHORS
+
+Brandon L Black <blblack@gmail.com>
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut
plan tests => 4;
-DBICTest::Schema->storage_type('::DBI::MSSQL');
+my $storage_type = '::DBI::MSSQL';
+$storage_type = '::DBI::Sybase::MSSQL' if $dsn =~ /^dbi:Sybase:/;
+# Add more for others in the future when they exist (ODBC? ADO? JDBC?)
+
+DBICTest::Schema->storage_type($storage_type);
DBICTest::Schema->compose_connection( 'MSSQLTest' => $dsn, $user, $pass );
my $dbh = MSSQLTest->schema->storage->dbh;