Acrux-DBI
view release on metacpan or search on metacpan
lib/Acrux/DBI.pm view on Meta::CPAN
# Binding params and execute
my $bind_values = $args->{bind_values} || [];
unless (is_array_ref($bind_values)) {
$self->error("Invalid list of binding values. Array ref expected");
return;
}
my $rv;
my $argb = '';
if (scalar @$bind_values) {
$argb = sprintf(" with bind values: %s",
join(", ", map {defined($_) ? sprintf("'%s\'", $_) : 'undef'} @$bind_values));
$rv = $sth->execute(@$bind_values);
} elsif (my $cb = $args->{bind_callback} || $args->{bind_cb}) {
unless (is_code_ref($cb)) {
$self->error("Invalid binding callback function. Code ref expected");
return;
}
$cb->($sth); # Callback! bind params
$rv = $sth->execute;
} else {
lib/Acrux/DBI/Res.pm view on Meta::CPAN
=head1 NAME
Acrux::DBI::Res - Results of your database queries
=head1 SYNOPSIS
use Acrux::DBI::Res;
my $res = Acrux::DBI::Res->new(sth => $sth);
$res->collection->map(sub { $_->{foo} })->shuffle->join("\n")->say;
=head1 DESCRIPTION
Class to works with results of your database queries
=head2 new
my $res = Acrux::DBI::Res->new( sth => $sth, dbi => $dbi );
Construct a new Acrux::DBI::Res object
( run in 0.294 second using v1.01-cache-2.11-cpan-65fba6d93b7 )