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