NAME
DBIO::Storage::DBI::Cursor - Object representing a query cursor on a resultset.
VERSION
version 0.900004
SYNOPSIS
my $cursor = $schema->resultset('CD')->cursor();
# raw values off the database handle in resultset columns/select order
my @next_cd_column_values = $cursor->next;
# list of all raw values as arrayrefs
my @all_cds_column_values = $cursor->all;
See t/cursor.t for a runnable example of this raw-value ->next/ ->all API (the public cursor contract shared with DBIO::Cursor).
DESCRIPTION
A Cursor represents a query cursor on a DBIO::ResultSet object. It allows for traversing the result set with "next", retrieving all results with "all" and resetting the cursor with "reset".
Usually, you would use the cursor methods built into DBIO::ResultSet to traverse it. See "next" in DBIO::ResultSet, "reset" in DBIO::ResultSet and "all" in DBIO::ResultSet for more information.
ATTRIBUTES
storage
Storage handle used to execute underlying select statements.
args
Arguments forwarded to $storage->_select(...).
attrs
Cursor/resultset attributes affecting fetch behavior.
METHODS
new
Returns a new DBIO::Storage::DBI::Cursor object.
next
Advances the cursor to the next row and returns an array of column values (the result of "fetchrow_array" in DBI method).
all
Returns a list of arrayrefs of column values for all rows in the DBIO::ResultSet.
is_exhausted
Returns true once the cursor has yielded its final row via "next" (or was explicitly retired via "mark_exhausted") without an intervening "reset"; false otherwise. Reads the internal _done flag.
position
Returns the number of rows handed out via "next" since the cursor was created or last "reset"; 0 if none have been fetched yet. Reads the internal _pos counter.
mark_exhausted
Flags the cursor as fully consumed without resetting it, so a subsequent "next" returns nothing. Sets the internal _done flag. Lets the collapse fast-path in DBIO::ResultSet retire a cursor after draining it via a stealth "all".
sth
Getter/setter for the underlying statement handle with process/thread safety checks.
reset
Resets the cursor to the beginning of the DBIO::ResultSet.
DESTROY
Ensures active statement handles are finished during object destruction.
__finish_sth
Internal helper to safely finish a statement handle, suppressing warnings.
AUTHOR
DBIO & DBIx::Class Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.