[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

55. Databases

Function: databasep object

This function returns non-nil if object is a database.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

55.1 Connecting to a Database

Function: open-database file &optional type subtype access mode

This function opens database file, using database method type and subtype, with access rights access and permissions mode. access can be any combination of r w and +, for read, write, and creation flags.

type can have the value 'dbm or 'berkeley-db to select the type of database file to use. (Note: XEmacs may not support both of these types.)

For a type of 'dbm, there are no subtypes, so subtype should be nil.

For a type of 'berkeley-db, the following subtypes are available: 'hash, 'btree, and 'recno. See the manpages for the Berkeley DB functions for more information about these types.

Function: close-database database

This function closes database database.

Function: database-live-p object

This function returns t if object is an active database, else nil.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

55.2 Working With a Database

Function: get-database key database &optional default

This function finds the value for key in database. If there is no corresponding value, default is returned (nil if default is omitted).

Function: map-database function database

This function maps function over entries in database, calling it with two args, each key and value in the database.

Function: put-database key value database &optional replace

This function stores key and value in database. If optional fourth arg replace is non-nil, replace any existing entry in the database.

Function: remove-database key database

This function removes key from database.



[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.