Backout sybase changes
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase.pm
CommitLineData
3885cff6 1package DBIx::Class::Storage::DBI::Sybase;
2
3use strict;
4use warnings;
2ad62d97 5
eabab5d0 6use base qw/
26283ee3 7 DBIx::Class::Storage::DBI::Sybase::Base
8 DBIx::Class::Storage::DBI::NoBindVars
eabab5d0 9/;
2ad62d97 10use mro 'c3';
98259fe4 11
47d9646a 12sub _rebless {
26283ee3 13 my $self = shift;
c5ce7cd6 14
c5ce7cd6 15 my $dbtype = eval {
26283ee3 16 @{$self->_get_dbh
17 ->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})
18 }[2]
19 };
20 unless ( $@ ) {
21 $dbtype =~ s/\W/_/gi;
22 my $subclass = "DBIx::Class::Storage::DBI::Sybase::${dbtype}";
23 if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
24 bless $self, $subclass;
a3a526cc 25 $self->_rebless;
a3a526cc 26 }
6b1f5ef7 27 }
a3a526cc 28}
29
26283ee3 30sub _dbh_last_insert_id {
31 my ($self, $dbh, $source, $col) = @_;
32 return ($dbh->selectrow_array('select @@identity'))[0];
1816be4f 33}
34
3885cff6 351;
36
26283ee3 37=head1 NAME
a3a526cc 38
26283ee3 39DBIx::Class::Storage::DBI::Sybase - Storage::DBI subclass for Sybase
e97a6ee2 40
26283ee3 41=head1 SYNOPSIS
a3a526cc 42
26283ee3 43This subclass supports L<DBD::Sybase> for real Sybase databases. If
44you are using an MSSQL database via L<DBD::Sybase>, see
45L<DBIx::Class::Storage::DBI::Sybase::MSSQL>.
e97a6ee2 46
26283ee3 47=head1 CAVEATS
a3a526cc 48
26283ee3 49This storage driver uses L<DBIx::Class::Storage::DBI::NoBindVars> as a base.
50This means that bind variables will be interpolated (properly quoted of course)
51into the SQL query itself, without using bind placeholders.
5703eb14 52
26283ee3 53More importantly this means that caching of prepared statements is explicitly
54disabled, as the interpolation renders it useless.
e97a6ee2 55
26283ee3 56=head1 AUTHORS
63d46bb3 57
26283ee3 58Brandon L Black <blblack@gmail.com>
3885cff6 59
26283ee3 60Justin Hunter <justin.d.hunter@gmail.com>
c5ce7cd6 61
3885cff6 62=head1 LICENSE
63
64You may distribute this code under the same terms as Perl itself.
65
66=cut