Next: , Previous: Collections, Up: Reference


3.6 Cursors

— Class: elephant:cursor

Class precedence list: cursor, standard-object, t

A cursor for traversing (primary) BTrees.

— Class: elephant:secondary-cursor

Class precedence list: secondary-cursor, cursor, standard-object, t

Cursor for traversing secondary indices.

— Generic Function: elephant:make-cursor bt

Construct a cursor for traversing BTrees.

— Generic Function: elephant:cursor-close cursor

Close the cursor. Make sure to close cursors before the enclosing transaction is closed!

— Macro: elephant:with-btree-cursor var &body body

Macro which opens a named cursor on a BTree (primary or not), evaluates the forms, then closes the cursor.

— Generic Function: elephant:cursor-current cursor

Get the key / value at the cursor position. Returns has-pair key value, where has-pair is a boolean indicating there was a pair.

— Generic Function: elephant:cursor-delete cursor

Delete by cursor. The cursor is at an invalid position after a successful delete.

— Generic Function: elephant:cursor-duplicate cursor

Duplicate a cursor.

— Generic Function: elephant:cursor-first cursor

Move the cursor to the beginning of the BTree, returning has-pair key value.

— Generic Function: elephant:cursor-get-both-range cursor key value

Moves the cursor to the first key / value pair with key equal to the key argument and value greater or equal to the value argument. Not really useful for us since primaries don't have duplicates. Returns has-pair key value.

— Generic Function: elephant:cursor-get-both cursor key value

Moves the cursor to a particular key / value pair, returning has-pair key value.

— Generic Function: elephant:cursor-last cursor

Move the cursor to the end of the BTree, returning has-pair key value.

— Generic Function: elephant:cursor-next-dup cursor

Move to the next duplicate element (with the same key.) Returns has-pair key value.

— Generic Function: elephant:cursor-next-nodup cursor

Move to the next non-duplicate element (with different key.) Returns has-pair key value.

— Generic Function: elephant:cursor-next cursor

Advance the cursor, returning has-pair key value.

— Generic Function: elephant:cursor-pcurrent cursor

Returns has-tuple / secondary key / value / primary key at the current position.

— Generic Function: elephant:cursor-pfirst cursor

Moves the key to the beginning of the secondary index. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pget-both-range cursor key value

Moves the cursor to a the first secondary key / primary key pair, with secondary key equal to the key argument, and primary key greater or equal to the pkey argument. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pget-both cursor key value

Moves the cursor to a particular secondary key / primary key pair. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-plast cursor

Moves the key to the end of the secondary index. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pnext-dup cursor

Move to the next duplicate element (with the same key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pnext-nodup cursor

Move to the next non-duplicate element (with different key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pnext cursor

Advances the cursor. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pprev-nodup cursor

Move to the previous non-duplicate element (with different key.) Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-pprev cursor

Moves the cursor back. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-prev-nodup cursor

Move to the previous non-duplicate element (with different key.) Returns has-pair key value.

— Generic Function: elephant:cursor-prev cursor

Move the cursor back, returning has-pair key value.

— Generic Function: elephant:cursor-pset-range cursor key

Move the cursor to the first key-value pair with key greater or equal to the key argument, according to the lisp sorter. Returns has-pair secondary key value primary key.

— Generic Function: elephant:cursor-pset cursor key

Moves the cursor to a particular key. Returns has-tuple / secondary key / value / primary key.

— Generic Function: elephant:cursor-put cursor value &key key

Put by cursor. Currently doesn't properly move the cursor.

— Generic Function: elephant:cursor-set-range cursor key

Move the cursor to the first key-value pair with key greater or equal to the key argument, according to the lisp sorter. Returns has-pair key value.

— Generic Function: elephant:cursor-set cursor key

Move the cursor to a particular key, returning has-pair key value.