Freeside:3:Documentation:Developer/FS/Cursor

From Freeside
< Freeside:3:Documentation:Developer‎ | FS
Revision as of 05:30, 10 February 2015 by Jeremyd (talk | contribs) (Edit via perl MediaWiki framework (1.13))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::Cursor - Iterator for querying large data sets

SYNOPSIS

use FS::Cursor;

my $search = FS::Cursor->new('table', { field => 'value' ... }); while ( my $row = $search->fetch ) { ... }

CLASS METHODS

new ARGUMENTS
Constructs a cursored search. Accepts all the same arguments as qsearch, and returns an FS::Cursor object to fetch the rows one at a time.

METHODS

fetch
Fetch the next row from the search results.

TO DO

Replace all uses of qsearch with this.

BUGS

Still doesn't really support MySQL, but it pretends it does, by simply running the query and returning records one at a time.

The cursor will close prematurely if any code issues a rollback/commit. If you need protection against this use qsearch or fork and get a new dbh handle. Normally this issue will represent itself this message. ERROR: cursor "cursorXXXXXXX" does not exist.

SEE ALSO

FS::Record