ANARDB - API reference

This is the API reference. There is also an introduction to this library.


 

Abstract

The code is released under the Lisp Lesser GPL.

Download shortcut: anardb.tar.gz.


 

Contents

  1. Download
  2. The ANARDB dictionary
    1. with-transaction
    2. defdbclass
    3. with-store-lock
    4. store-object
    5. retrieve-all-instances
    6. store-init-dir
    7. store-dir
    8. restart-transaction
    9. drop
    10. store-wipe
    11. freshen-object
    12. store-reset
    13. do-all-instances
    14. object-absent
    15. object-absent
    16. assert-in-transaction
    17. *store*
    18. make-store
    19. store-object-id
    20. store-update
    21. retrieve-instance-by-id
  3. Acknowledgements

 

Download

ANARDB together with this documentation can be downloaded from anardb.tar.gz.


 

The ANARDB dictionary


[Macro]
with-transaction (&key message store on-restart) declaration* statement* => result

Protect changes to a store with a transaction.

If the transaction fails (because another process updated the store
before the changes could be saved) then the store will be rolled
forward and the BODY will be run again.

Rolls the store forward to the latest serialisation on start, if the
file serialisation is newer than the last one loaded.

Note that it will wipe unsaved changes to the store iff the last
serialisation loaded is older than the newest available
serialisation. Therefore it will not wipe unsaved changes if the store
is not backed with a directory, or no other process has written to the
store since the last load.

If with-transaction returns normally, then it is successful and the
changes have been committed to disk.



[Macro]
defdbclass name direct-supers direct-slots &rest options => result

Define a class of serialisable objects.

Syntax is like defclass but accessors and initargs are defined by default.

Additional slot option :index specifies whether a slot's value should
be indexed in a hash table. Note that changing an indexed slot's value
is not supported.

Additional class option :finder specifies the name of a helper
function (by default (symbolicate 'find- classname)), which can be
used to lookup class instances.

Additional class option :store specifies the variable pointing to the
store responsible for objects of this class.



[Macro]
with-store-lock (store) declaration* statement* => result

Prevent the store from being updated.

Note that if you wait too long, the lock may be broken by another process.
See *hard-break-delay*.


[Standard class]
store-object

Base class of all classes defined through defdbclass


[Function]
retrieve-all-instances class => result

Retrieve a list of instances of class CLASS


[Function]
store-init-dir store &optional new-dir => result

Create a new database in the file-system


[Specialized accessor]
store-object-id (condition store-object) => result
(setf (store-object-id (condition store-object)) new-value)

automatically generated reader method


[Accessor]
store-dir instance => result
(setf (store-dir instance) new-value)

A place for clients to stash things.


[Function]
restart-transaction => result

Restart the innermost transaction


[Generic function]
drop object => result

Remove object from the database


[Function]
store-wipe store => result




[Function]
freshen-object object => result




[Function]
store-reset store &optional new-dir => result




[Macro]
do-all-instances (var class) declaration* statement* => result




[Condition type]
object-absent




[Function]
object-absent &rest args => result




[Macro]
assert-in-transaction &optional store => result




[Special variable]
*store*




[Function]
make-store &key (next-id dum0) (dir dum1) (version dum2) (classnames dum3) => result




[Generic accessor]
store-object-id condition => result
(setf (store-object-id condition) new-value)




[Specialized accessor]
store-object-id (condition object-absent) => result
(setf (store-object-id (condition object-absent)) new-value)




[Function]
store-update store => result




[Generic function]
retrieve-instance-by-id classname id => result




[Method]
retrieve-instance-by-id (classname class) id => result




[Method]
drop (object store-object) => result




[Method]
drop object => result




[Method]
drop (object sequence) => result




 

Acknowledgements

This documentation was prepared with a modified version of DOCUMENTATION-TEMPLATE.

$Header: /usr/local/cvsrep/documentation-template/output.lisp,v 1.14 2008/05/29 08:23:37 edi Exp $

BACK TO THE MAIN PROJECT PAGE