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