lmdb-high-level-0.1: Higher level API for working with LMDB

Lmdb.Multimap

Synopsis

# Documentation

lookupValues :: MultiCursor e k v -> k -> Producer' v IO () Source #

Lookup all values at the given key. These values are provided as a Producer since there can be many pages of values. Since the resulting Producer captures the Cursor given as the first argument, it should not escape the call to withCursor in which the Cursor was bound. Additionally, the Producer should be consumed before any other functions that use the Cursor are called. It is fine if the Producer is not consumed entirely, as long as the caller is not dependending on the cursor to end in a particular place.

If values are encoded and decoded by a Codec that uses a fixed length, this function will take advantage of MDB_GET_MULTIPLE and MDB_NEXT_MULTIPLE.

insert :: MultiCursor ReadWrite k v -> k -> v -> IO () Source #

Insert a key-value pair. If the value already exists at the key, do not add another copy of it. This treats the existing values corresponding to each key as a set. This uses MDB_NODUPDATA.

dupsert :: MultiCursor ReadWrite k v -> k -> v -> IO () Source #

Insert a key-value pair. If the value already exists at the key, add another copy of it. This treats the existing values corresponding to each key as a bag.