chickadee » lmdb-lolevel » mdb-put

mdb-put txn dbi key data flagsprocedure

Store items into a database.

This function stores key/data pairs in the database. The default behavior is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed, or adding a duplicate data item if duplicates are allowed (MDB_DUPSORT).

txn
A transaction handle returned by (mdb-txn-begin)
dbi
A database handle returned by (mdb-dbi-open)
key
The key to store in the database (blob)
data
The data to store (blob)
flags
Special options for this operation. This parameter must be set to 0 or by bitwise OR'ing together (using the bitwise-ior procedure) one or more of the values described in the 'Put Flags' section in Contants.

Some possible error conditions:

(exn lmdb MDB_MAP_FULL)
the database is full, see (mdb-env-set-mapsize).
(exn lmdb MDB_TXN_FULL)
the transaction has too many dirty pages.
(exn lmdb EACCES)
an attempt was made to write in a read-only transaction.
(exn lmdb EINVAL)
an invalid parameter was specified.