| Class BDB::Cursor |
|
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.
| Methods |
| Public Instance methods |
| close() |
Discards the cursor.
| c_close() |
same than close
| count() |
Return the count of duplicate
| c_count() |
same than count
| current() |
Same than get(BDB::CURRENT)
| c_current() |
same than current
| del() |
Deletes the key/data pair currently referenced by the cursor.
| delete() |
same than del
| c_del() |
same than del
| dup(flags = 0) |
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.
| clone(flags = 0) |
same than dup
| c_dup(flags = 0) |
same than dup
| c_clone(flags = 0) |
same than dup
| first() |
Same than get(BDB::FIRST)
| c_first() |
same than first
| get(flags, key = nil, value = nil) |
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
| c_get(flags, key = nil, value = nil) |
same than get
| last() |
Same than get(BDB::LAST)
| c_last() |
same than last
| next() |
Same than get(BDB::NEXT)
| c_next() |
same than next
| pget(flags, key = nil, value = nil) |
Retrieve key/primary key/data pair from the database
| c_pget(flags, key = nil, value = nil) |
same than pget
| prev() |
Same than get(BDB::PREV)
| c_prev() |
same than prev
| put(flags, value) |
Stores data value into the database.
See the description of c_put in the Berkeley distribution for the different values of the flags parameter.
| c_put(flags, value) |
same than put
| put(flags, key, value) |
Stores key/data pairs into the database (only for Btree and Hash access methods)
flags must have the value BDB::KEYFIRST or BDB::KEYLAST
| c_put(flags, key, value) |
same than put
| set(key) |
Same than get with the flags BDB::SET or BDB::SET_RANGE or BDB::SET_RECNO
| c_set(key) |
same than set
| set_range(key) |
same than set
| c_set_range(key) |
same than set
| set_recno(key) |
same than set
| c_set_recno(key) |
same than set