use warnings;
use base 'DBIx::Class::Storage::DBI';
+use Scalar::Util ();
+use Carp::Clan qw/^DBIx::Class/;
=head1 NAME
sub _prep_for_execute {
my $self = shift;
- my ($op, $extra_bind, $ident) = @_;
+ my ($op, $extra_bind, $ident, $rsrc) = @_;
my ($sql, $bind) = $self->next::method(@_);
foreach my $bound (@$bind) {
my $col = shift @$bound;
+
my $datatype = 'FIXME!!!';
+
+# this is what needs to happen:
+# my $datatype = $rsrc->column_info($col)->{data_type};
+
foreach my $data (@$bound) {
if(ref $data) {
$data = ''.$data;
DBIx::Class::Storage::DBI::NoBindVars
DBIx::Class::Storage::DBI::Sybase
/;
+use List::Util ();
sub _dbh_last_insert_id {
my ($self, $dbh, $source, $col) = @_;
return ($dbh->selectrow_array('select @@identity'))[0];
}
-my $noquote = {
- int => qr/^ \-? \d+ $/x,
- integer => qr/^ \-? \d+ $/x,
+my %noquote = (
+ int => sub { /^ -? \d+ \z/x },
# TODO maybe need to add float/real/etc
-};
+);
sub should_quote_data_type {
my $self = shift;
return $self->next::method(@_) if not defined $value;
- if (my $re = $noquote->{$type}) {
- return 0 if $value =~ $re;
+ if (my $key = List::Util::first { $type =~ /^$_/i } keys %noquote) {
+ local $_ = $value;
+ return 0 if $noquote{$key}->();
}
return $self->next::method(@_);
}
-
1;
=head1 NAME