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