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