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.
A cursor is created with the methods BDB::Common#cursor
and BDB::Common#cursor_write
Public Instance Methods
Source
# File cursor.rb, line 89 def c_get(flags, key = nil, value = nil) end
same than get
Source
# File cursor.rb, line 113 def c_pget(flags, key = nil, value = nil) end
same than pget
Source
# File cursor.rb, line 38 def del() end
Deletes the key/data pair currently referenced by the cursor.
Source
# File cursor.rb, line 56 def dup(flags = 0) end
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.
Source
# File cursor.rb, line 86 def get(flags, key = nil, value = nil) end
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
Source
# File cursor.rb, line 110 def pget(flags, key = nil, value = nil) end
Retrieve key/primary key/data pair from the database
Source
# File cursor.rb, line 129 def put(flags, value) end
Stores data value into the database.
See the description of c_put
in the Berkeley distribution for the different values of the flags parameter.
Source
# File cursor.rb, line 150 def set(key) end
Same than get
with the flags BDB::SET or BDB::SET_RANGE or BDB::SET_RECNO