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';
+ my $dbtype = eval { @{$self->dbh->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})}[2] };
+ unless ( $@ ) {
+ $dbtype =~ s/\W/_/gi;
+ my $subclass = "DBIx::Class::Storage::DBI::Sybase::${dbtype}";
if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
bless $self, $subclass;
$self->_rebless;
}
}
+sub _dbh_last_insert_id {
+ my $self = shift;
+ my $sth = $self->_dbh->prepare_cached('select @@identity');
+ ($self->_dbh->selectrow_array($sth))[0];
+}
+
1;
=head1 NAME
you are using an MSSQL database via L<DBD::Sybase>, see
L<DBIx::Class::Storage::DBI::Sybase::MSSQL>.
+=head1 CAVEATS
+
+This storage driver uses L<DBIx::Class::Storage::DBI::NoBindVars> as a base.
+This means that bind variables will be interpolated (properly quoted of course)
+into the SQL query itself, without using bind placeholders.
+
+More importantly this means that caching of prepared statements is explicitly
+disabled, as the interpolation renders it useless.
+
=head1 AUTHORS
Brandon L Black <blblack@gmail.com>