Next: , Previous: Persistent Slot Indexing, Up: Reference


3.5 Collections

— Class: elephant:persistent-collection

Class precedence list: persistent-collection, persistent, standard-object, t

Abstract superclass of all collection types.

— Class: elephant:btree

Class precedence list: btree, persistent-collection, persistent, standard-object, t

A hash-table like interface to a BTree, which stores things in a semi-ordered fashion.

— Class: elephant:indexed-btree

Class precedence list: indexed-btree, btree, persistent-collection, persistent, standard-object, t

A BTree which supports secondary indices.

— Class: elephant:btree-index

Class precedence list: btree-index, persistent-object, btree, persistent-collection, persistent, standard-object, t

Secondary index to an indexed-btree.

— Generic Function: elephant:get-value key bt

Get a value from a Btree.

— Generic Function: (setf elephant:get-value)

Put a key / value pair into a BTree.

— Method: (setf elephant:get-value) value key (bt btree-index)

Puts are not allowed on secondary indices. Try adding to the primary.

— Generic Function: elephant:remove-kv key bt

Remove a key / value pair from a BTree.

— Method: elephant:remove-kv key (bt btree-index)

Remove a key / value from the primary by a secondary lookup, updating all other secondary indices.

— Generic Function: elephant:add-index bt &key index-name key-form populate

Add a secondary index. The indices are stored in an eq hash-table, so the index-name should be a symbol. key-form should be a symbol naming a function, or a list which defines a lambda -- actual functions aren't supported. The function should take 3 arguments: the secondary db, primary key and value, and return two values: a boolean indicating whether to index this key / value, and the secondary key if so. If populate = t it will fill in secondary keys for existing primary entries (may be expensive!)

— Generic Function: elephant:get-index bt index-name

Get a named index.

— Generic Function: elephant:get-primary-key key bt

Get the primary key from a secondary key.

— Generic Function: elephant:remove-index bt index-name

Remove a named index.