#use Data::Dumper; warn Dumper(@_);
$it_class = ref $it_class if ref $it_class;
unless ($sth) {
+ $attrs->{bind} = $args;
$sth = $db_class->storage->select($db_class->_table_name,$cols,
$attrs->{where},$attrs);
}
package DBIx::Class::Storage::DBI;
+use strict;
+use warnings;
use DBI;
use base qw/DBIx::Class/;
my $sql = $self->create_sql('insert', [ keys %{$to_insert} ], $ident, undef);
my $sth = $self->sth($sql);
$sth->execute(values %{$to_insert});
- $self->throw( "Couldn't insert ".join(%to_insert)." into ${ident}" )
+ $self->throw( "Couldn't insert ".join(', ', map "$_ => $to_insert->{$_}", keys %$to_insert)." into ${ident}" )
unless $sth->rows;
return $to_insert;
}
my $sql = $self->create_sql('select', $select, $ident, $cond_sql);
#warn $sql.' '.join(', ', @{$attrs->{bind}||[]});
my $sth = $self->sth($sql);
- if (@{$attrs->{bind}||[]}) {
- $sth->execute( @{$attrs->{bind}||[]} );
- } else {
- # disable unexplained 'Use of uninitialized value in subroutine entry'
- # warnings
- no warnings 'uninitialized';
- $sth->execute;
- }
+ $sth->execute( @{$attrs->{bind}||[]} );
return $sth;
}