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
same than dup
# File cursor.rb, line 65 def c_clone(flags = 0) end
same than close
# File cursor.rb, line 17 def c_close() end
same than count
# File cursor.rb, line 25 def c_count() end
same than current
# File cursor.rb, line 33 def c_current() end
same than del
# File cursor.rb, line 44 def c_del() end
same than dup
# File cursor.rb, line 62 def c_dup(flags = 0) end
same than first
# File cursor.rb, line 73 def c_first() end
same than get
# File cursor.rb, line 89 def c_get(flags, key = nil, value = nil) end
same than last
# File cursor.rb, line 97 def c_last() end
same than next
# File cursor.rb, line 105 def c_next() end
same than pget
# File cursor.rb, line 113 def c_pget(flags, key = nil, value = nil) end
same than prev
# File cursor.rb, line 121 def c_prev() end
same than put
# File cursor.rb, line 132 def c_put(flags, value) end
same than set
# File cursor.rb, line 153 def c_set(key) end
same than set
# File cursor.rb, line 159 def c_set_range(key) end
same than set
# File cursor.rb, line 165 def c_set_recno(key) end
same than dup
# File cursor.rb, line 59 def clone(flags = 0) end
Discards the cursor.
# File cursor.rb, line 14 def close() end
Return the count of duplicate
# File cursor.rb, line 22 def count() end
Same than get(BDB::CURRENT)
# File cursor.rb, line 30 def current() end
Deletes the key/data pair currently referenced by the cursor.
# File cursor.rb, line 38 def del() end
same than del
# File cursor.rb, line 41 def delete() 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.
# File cursor.rb, line 56 def dup(flags = 0) end
Same than get(BDB::FIRST)
# File cursor.rb, line 70 def first() 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
# File cursor.rb, line 86 def get(flags, key = nil, value = nil) end
Same than get(BDB::LAST)
# File cursor.rb, line 94 def last() end
Same than get(BDB::NEXT)
# File cursor.rb, line 102 def next() end
Retrieve key/primary key/data pair from the database
# File cursor.rb, line 110 def pget(flags, key = nil, value = nil) end
Same than get(BDB::PREV)
# File cursor.rb, line 118 def prev() 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.
# File cursor.rb, line 129 def put(flags, value) end
Same than get
with the flags BDB::SET or
BDB::SET_RANGE or BDB::SET_RECNO
# File cursor.rb, line 150 def set(key) end
same than set
# File cursor.rb, line 156 def set_range(key) end
same than set
# File cursor.rb, line 162 def set_recno(key) end