NAME
DBIx::Custom::Result - Result of select
SYNOPSIS
# Result
my $result = $dbi->select(table => 'books');
# Fetch a row into array
while (my $row = $result->fetch) {
my $value1 = $row->[0];
my $valuu2 = $row->[1];
# do something
}
# Fetch only first row into array
my $row = $result->fetch_first;
# Fetch multiple rows into array of array
while (my $rows = $result->fetch_multi(5)) {
# do something
}
# Fetch all rows into array of array
my $rows = $result->fetch_all;
# Fetch hash into hash
while (my $row = $result->fetch_hash) {
my $value1 = $row->{title};
my $value2 = $row->{author};
# do something
}
# Fetch only first row into hash
my $row = $result->fetch_hash_first;
# Fetch multiple rows into array of hash
while (my $rows = $result->fetch_hash_multi) {
# do something
}
# Fetch all rows into array of hash
my $rows = $result->fetch_hash_all;
ATTRIBUTES
sth
my $sth = $reuslt->sth
$result = $result->sth($sth);
Statement handle.
default_filter
my $default_filter = $result->default_filter;
$result = $result->default_filter('decode_utf8');
Default filter for fetching.
filter
my $filter = $result->filter;
$result = $result->filter({title => 'decode_utf8'});
Filters for fetching.
METHODS
This class is Object::Simple subclass. You can use all methods of Object::Simple
fetch
$row = $result->fetch;
Fetch a row into array
while (my $row = $result->fetch) {
# do something
my $value1 = $row->[0];
my $value2 = $row->[1];
}
fetch_first
$row = $result->fetch_first;
Fetch only first row into array and finish statment handle.
fetch_multi
$rows = $result->fetch_multi($count);
Fetch multiple rows into array of array.
while(my $rows = $result->fetch_multi(10)) {
# do someting
}
fetch_all
$rows = $result->fetch_all;
Fetch all rows into array of array.
fetch_hash
$row = $result->fetch_hash;
Fetch a row into hash
while (my $row = $result->fetch_hash) {
my $val1 = $row->{title};
my $val2 = $row->{author};
# do something
}
fetch_hash_first
$row = $result->fetch_hash_first;
Fetch only first row into hash and finish statment handle.
fetch_hash_multi
$rows = $result->fetch_hash_multi($count);
Fetch multiple rows into array of hash
while(my $rows = $result->fetch_hash_multi(10)) {
# do someting
}
fetch_hash_all
$rows = $result->fetch_hash_all;
Fetch all rows into array of hash.