Commit | Line | Data |
3885cff6 |
1 | package DBIx::Class::Storage::DBI::Sybase; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use base qw/DBIx::Class::Storage::DBI::NoBindVars/; |
7 | |
5432c6ae |
8 | my $noquote = { |
9 | int => qr/^ \-? \d+ $/x, |
10 | integer => qr/^ \-? \d+ $/x, |
11 | |
12 | # TODO maybe need to add float/real/etc |
13 | }; |
b50a5275 |
14 | |
15 | sub should_quote_data_type { |
16 | my $self = shift; |
5432c6ae |
17 | my ($type, $value) = @_; |
18 | |
19 | return $self->next::method(@_) if not defined $value; |
20 | |
21 | if (my $re = $noquote->{$type}) { |
22 | return 0 if $value =~ $re; |
23 | } |
24 | |
b50a5275 |
25 | return $self->next::method(@_); |
26 | } |
27 | |
3885cff6 |
28 | 1; |
29 | |
30 | =head1 NAME |
31 | |
32 | DBIx::Class::Storage::DBI::Sybase - Storage::DBI subclass for Sybase |
33 | |
34 | =head1 SYNOPSIS |
35 | |
81092e2d |
36 | This subclass supports L<DBD::Sybase> for real Sybase databases. If |
37 | you are using an MSSQL database via L<DBD::Sybase>, see |
38 | L<DBIx::Class::Storage::DBI::Sybase::MSSQL>. |
3885cff6 |
39 | |
40 | =head1 AUTHORS |
41 | |
42 | Brandon L Black <blblack@gmail.com> |
43 | |
44 | =head1 LICENSE |
45 | |
46 | You may distribute this code under the same terms as Perl itself. |
47 | |
48 | =cut |