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