Changes
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase / Base.pm
CommitLineData
4966150b 1package # hide from PAUSE
2 DBIx::Class::Storage::DBI::Sybase::Base;
3
4use strict;
5use warnings;
6
7use base qw/DBIx::Class::Storage::DBI/;
8use mro 'c3';
9
10=head1 NAME
11
12DBIx::Class::Storage::DBI::Sybase::Base - Common functionality for drivers using
13DBD::Sybase
14
15=cut
16
17sub _ping {
18 my $self = shift;
19
20 my $dbh = $self->_dbh or return 0;
21
22 local $dbh->{RaiseError} = 1;
23 eval {
24 $dbh->do('select 1');
25 };
26
27 return $@ ? 0 : 1;
28}
29
30sub _placeholders_supported {
31 my $self = shift;
32 my $dbh = $self->_get_dbh;
33
34 return eval {
35# There's also $dbh->{syb_dynamic_supported} but it can be inaccurate for this
36# purpose.
37 local $dbh->{PrintError} = 0;
38 local $dbh->{RaiseError} = 1;
39# this specifically tests a bind that is NOT a string
40 $dbh->selectrow_array('select 1 where 1 = ?', {}, 1);
41 };
42}
43
441;
45
46=head1 AUTHORS
47
48See L<DBIx::Class/CONTRIBUTORS>.
49
50=head1 LICENSE
51
52You may distribute this code under the same terms as Perl itself.
53
54=cut