Next: Persistent Object API, Up: User API Reference
Store controllers provide the persistent storage for CLOS objects and BTree collections. Any persistent operations must be done in the context of a store controller. The default store-controller is stored in a global variable.
Class elephant:store-controller is associated with the following user methods and macros:
Executes the body with an open controller, unconditionally closing the controller on exit.
Conveniently open a store controller. Set *store-controller* to the new controller unless it is already set (opening a second controller means you must keep track of controllers yourself. *store-controller* is a convenience variable for single-store applications or single-store per thread apps. Multi-store apps should either confine their *store-controller* to a given dynamic context or wrap each store-specific op in a transaction using with or ensure transaction. Returns the opened store controller.
Conveniently close the store controller. If you pass a custom store controller, you are responsible for setting it to
nil
.
Get the value associated with key from the root. Returns two values, the value, or nil, and a boolean indicating whether a value was found or not (so you know if nil is a value or an indication of non-presence)