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