NAME
BerkeleyDB::Easy::Cursor - Cursor to database handle
METHODS
Most of the functionaly for BerkeleyDB cursors are crammed into a few underlying functions, with the behavior specified by a flag. For example, to get the next record, you call c_get
and provide the DB_NEXT
flag. In this module, these are split out into individual wrapper methods, and the required flag is provided for you. You can specify additional flags and they will be OR'ed together with the default.
first
Get the first record.
($key, $val) = $cursor->first();
last
Get the last record.
($key, $val) = $cursor->last();
next
Get the next record.
($key, $val) = $cursor->next();
prev
Move the previous record.
($key, $val) = $cursor->prev();
current
Get the record at the current position.
($key, $val) = $cursor->current();
set
Position the cursor to the specified key.
($key, $val) = $cursor->set($key);
after
Set the next record to the specified value. Returns true on success.
$bool = $cursor->after($val);
before
Set the previous record to the specified value.
$bool = $cursor->before($val);
replace
Replace the record at the current position.
$bool = $cursor->replace($val);
del
Delete the current record.
$bool = $cursor->del();
close
Close the cursor.
$bool = $cursor->close();
BUGS
This module is functional but unfinished.
AUTHOR
Rob Schaber, <robschaber at gmail.com>
LICENSE
Copyright 2013 Rob Schaber.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.