Commit | Line | Data |
---|---|---|
6dc4be0f | 1 | package # hide from PAUSE |
2 | DBIx::Class::Storage::DBI::Sybase::Base; | |
eabab5d0 | 3 | |
4 | use strict; | |
5 | use warnings; | |
6 | ||
2ad62d97 | 7 | use base qw/DBIx::Class::Storage::DBI/; |
8 | use mro 'c3'; | |
9 | ||
eabab5d0 | 10 | =head1 NAME |
11 | ||
12 | DBIx::Class::Storage::DBI::Sybase::Base - Common functionality for drivers using | |
2932b9a6 | 13 | DBD::Sybase |
eabab5d0 | 14 | |
eabab5d0 | 15 | =cut |
16 | ||
6dc4be0f | 17 | sub _ping { |
eabab5d0 | 18 | my $self = shift; |
19 | ||
d7ffa0ce | 20 | my $dbh = $self->_dbh or return 0; |
d7ffa0ce | 21 | |
526dc858 | 22 | local $dbh->{RaiseError} = 1; |
eabab5d0 | 23 | eval { |
283fb613 | 24 | $dbh->do('select 1'); |
eabab5d0 | 25 | }; |
26 | ||
27 | return $@ ? 0 : 1; | |
28 | } | |
29 | ||
7624b54e | 30 | sub _placeholders_supported { |
31 | my $self = shift; | |
86e68d2d | 32 | my $dbh = $self->last_dbh; |
7624b54e | 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; | |
57ee81d0 | 38 | local $dbh->{RaiseError} = 1; |
79e18edb | 39 | # this specifically tests a bind that is NOT a string |
7624b54e | 40 | $dbh->selectrow_array('select 1 where 1 = ?', {}, 1); |
41 | }; | |
42 | } | |
43 | ||
eabab5d0 | 44 | 1; |
45 | ||
46 | =head1 AUTHORS | |
47 | ||
48 | See L<DBIx::Class/CONTRIBUTORS>. | |
49 | ||
50 | =head1 LICENSE | |
51 | ||
52 | You may distribute this code under the same terms as Perl itself. | |
53 | ||
54 | =cut |