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