chickadee » lmdb-lolevel » mdb-get

mdb-get txn dbi keyprocedure

Get items from a database.

This function retrieves key/data pairs from the database. The address and length of the data associated with the specified key are returned in the structure to which data refers. If the database supports duplicate keys (MDB_DUPSORT) then the first data item for the key will be returned. Retrieval of other items requires the use of (mdb-cursor-get). This function will raise an (exn lmdb MDB_NOTFOUND) condition if the specified key is not in the database.

A transaction handle returned by (mdb-txn-begin)
A database handle returned by (mdb-dbi-open)
The key to search for in the database (blob)

Some possible error conditions:

(exn lmdb MDB_NOTFOUND)
the key was not in the database.
(exn lmdb EINVAL)
an invalid parameter was specified.