Class BDB::Cursor
In: cursor.rb
Parent: Object

A database cursor is a sequential pointer to the database entries. It allows traversal of the database and access to duplicate keyed entries. Cursors are used for operating on collections of records, for iterating over a database, and for saving handles to individual records, so that they can be modified after they have been read.

A cursor is created with the methods BDB::Common#cursor and BDB::Common#cursor_write

Methods

c_clone   c_close   c_count   c_current   c_del   c_dup   c_first   c_get   c_last   c_next   c_pget   c_prev   c_put   c_put   c_set   c_set_range   c_set_recno   clone   close   count   current   del   delete   dup   first   get   last   next   pget   prev   put   put   set   set_range   set_recno  

Public Instance methods

same than close

same than count

same than del

same than first

same than last

same than next

same than prev

same than set

Discards the cursor.

Return the count of duplicate

Same than get(BDB::CURRENT)

Deletes the key/data pair currently referenced by the cursor.

same than del

Creates new cursor that uses the same transaction and locker ID as the original cursor. This is useful when an application is using locking and requires two or more cursors in the same thread of control.

flags can have the value BDB::DB_POSITION, in this case the newly created cursor is initialized to reference the same position in the database as the original cursor and hold the same locks.

Same than get(BDB::FIRST)

Retrieve key/data pair from the database

See the description of c_get in the Berkeley distribution for the different values of the flags parameter.

key must be given if the flags parameter is BDB::SET | BDB::SET_RANGE | BDB::SET_RECNO

key and value must be specified for BDB::GET_BOTH

Same than get(BDB::LAST)

Same than get(BDB::NEXT)

Retrieve key/primary key/data pair from the database

Same than get(BDB::PREV)

Stores data value into the database.

See the description of c_put in the Berkeley distribution for the different values of the flags parameter.

Stores key/data pairs into the database (only for Btree and Hash access methods)

flags must have the value BDB::KEYFIRST or BDB::KEYLAST

Same than get with the flags BDB::SET or BDB::SET_RANGE or BDB::SET_RECNO

[Validate]