h$)/$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2021 Francisco Vallarino#BSD-3-Clause (see the LICENSE file)fjvallarino@gmail.com experimental non-portableNone2< r!libmdbxFlags for cursor operations.libmdbx=Cursor instance. Used for efficient navigation in a database.libmdbx&Flags for all data related operations.!libmdbx8Binary blob representing a key or value in the database.%libmdbxFlags for a database./libmdbx>Database instance. Represents a logical table in the database.0libmdbxFlags for a transaction.7libmdbxTransaction instance. Needed for all operations with data, even reading.9libmdbxUNIX permissions to set on created files. Zero value means to open existing, but do not create.:libmdbx"Flags for opening and environment.Llibmdbx2Environment object, needed for all the operations.Nlibmdbx)Error codes for the different operations.}libmdbxCreates an environment. Represents a database in the file system.~libmdbx4Opens an environment. Receives name, flags and mode.libmdbxCloses an environment.libmdbxBegins a new transaction. Arguments: Environment.Parent transaction, or Nothing.Flags.libmdbxCommits a transaction.libmdbxAborts a transaction.libmdbx(Gets the environment from a transaction.libmdbxOpens a database. Arguments: Transaction.Name.Flags.libmdbxCloses a database.libmdbxSample empty valuelibmdbxStores a key/value pair. Arguments: Transaction. Database.Key.Value.libmdbx Gets a value with the given key. Arguments: Transaction. Database.Key.libmdbx Gets a value with the given key. Arguments: Transaction. Database.Key.libmdbxOpens a new cursor. Arguments: Transaction. Database.libmdbxCloses a cursor.libmdbx#Removes the current key/value pair.libmdbx#Returns the current key/value pair.libmdbx#Sets the value for the current key. Arguments:Cursor.Key.Value.FLags.libmdbx3Returns the count of duplicates in the current key.libmdbx0Returns the description of a given error number.libmdbx%Compares two values as a binary blob.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:;<=>?@ABCDEFGHIJKLM9}~012345678%&'()*+,-./!"#$  NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|(c) 2021 Francisco Vallarino#BSD-3-Clause (see the LICENSE file)fjvallarino@gmail.com experimental non-portableNone?libmdbxCompares two keys and returns -1, 0 or 1 if key1 is lower, equal or greater than key2.libmdbxOpens an environment.libmdbxClose an environment.libmdbxBegins a transaction.libmdbxCommits a transaction.libmdbxAborts a transaction.libmdbxOpens a database (table).libmdbxCloses a database.libmdbx6Returns the value associated to the given key, if any.libmdbx"Saves the provided key/value pair.libmdbx8Deletes the value associated with the given key, if any.libmdbxOpens a cursor.libmdbxCloses a cursor.libmdbxStores the provided value at the given key, positioning the cursor on it.libmdbx*Deletes the value at the current position.libmdbx'Moves to the first key on the database.libmdbx&Moves to the last key on the database.libmdbxMoves to the given key.libmdbxMoves to the given key or first greater than it. Useful for searching.libmdbxMoves to the next key.libmdbxMoves to the previous key.libmdbx.Moves the cursor using the provided operation.(c) 2021 Francisco Vallarino#BSD-3-Clause (see the LICENSE file)fjvallarino@gmail.com experimental non-portableNonelibmdbxConverts an instance to/from the representation needed by libmdbx. This type is used for both keys and values. Only the  instance is provided, since it is commonly used as the key when storing/retrieving a value.For your own types, in general, you will want to use a serialization library such as  )https://hackage.haskell.org/package/storestore,  *https://hackage.haskell.org/package/cerealcereal0, etc, and apply the newtype deriving via trick.The  instance can be defined as: newtype MdbxItemStore a = MdbxItemStore { unwrapStore :: a } instance Store a => MdbxItem (MdbxItemStore a) where fromMdbxVal item = MdbxItemStore  $ fromMdbxStore item toMdbxVal item = withMdbxStore (unwrapStore item) fromMdbxStore :: Store v => MdbxVal -> IO v fromMdbxStore (MdbxVal size ptr) = do bs <- unsafePackCStringLen (castPtr ptr, fromIntegral size) decodeIO bs withMdbxStore :: Store v => v -> (MdbxVal -> IO a) -> IO a withMdbxStore val fn = unsafeUseAsCStringLen bsV $ (ptrV, sizeV) -> do let mval = MdbxVal (fromIntegral sizeV) (castPtr ptrV) fn mval where bsV = encode val This code can be adaptad to other serialization libraries. It is not provided as part of libmdbx-hs itself to avoid forcing dependencies.0Then, to derive the instance for your owwn type: data User = User { _username :: Text, _password :: Text } deriving (Eq, Show, Generic, Store) deriving via (MdbxItemStore User) instance MdbxItem User Note: if you plan on using a custom type as the key, be careful if it contains  or  instances, since these types have a length field which is, in general, before the data. This causes issues when using cursors, since they depend on key ordering and the length field will make shorter instances lower than longer ones, even if the content indicates the opposite. In general, it is simpler to use  as the key.libmdbxConverts a block of memory provided by libmdbx to a user data type. There are no guarantees provided by the library that the block of memory matches the expected type, and a crash can happen if not careful.  !"#$%&'()*+,-./012345679:;<=>?@ABCDEFGHIJKLL7/!"#$9:;<=>?@ABCDEFGHIJK0123456%&'()*+,-.  (c) 2021 Francisco Vallarino#BSD-3-Clause (see the LICENSE file)fjvallarino@gmail.com experimental non-portableNone#libmdbx8Returns the value associated with the given key, if any.libmdbxReturns the values associated to a list of keys. Returned length may not match that of provided keys in case some of them are not found.libmdbxReturns the list of values whose keys lie between the provided range.libmdbxSaves the given key/value pair.libmdbx>Saves the given key/value pairs. Runs in a single transaction.libmdbx7Deletes the item associated with the given key, if any.libmdbxDeletes the items associated with the given keys, if any. Runs in a single transaction.libmdbxThe environment.libmdbx The database.libmdbxThe key to lookup.libmdbxThe matching value, if any.libmdbxThe environment.libmdbx The database.libmdbxThe keys to lookup.libmdbx7The matching values. Length may not match that of keys.libmdbxThe environment.libmdbx The database.libmdbx#The start of the range (inclusive).libmdbx!The end of the range (inclusive).libmdbxThe matching values.libmdbxThe environment.libmdbx The database.libmdbxThe key.libmdbx The value.libmdbxThe environment.libmdbx The database.libmdbxThe list of key/value pairs.libmdbxThe environment.libmdbx The database.libmdbxThe key to delete.libmdbxThe environment.libmdbx The database.libmdbxThe keys to delete. (c) 2021 Francisco Vallarino#BSD-3-Clause (see the LICENSE file)fjvallarino@gmail.com experimental non-portableNone#  !"#$%.-,+*)(&'/065431279:KJIHGFEDCBA@?>=;?@@ABCDEFGHIJKLMNOPQRSTTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        &libmdbx-0.1.0.3-8AqqJKBYKACHTkko5IOh0fMdbx.FFIMdbx.API Mdbx.Types Mdbx.Database Data.StoreStoreData.ByteString ByteStringMdbx Paths_libmdbx MdbxCursorOp MdbxFirst MdbxFirstDup MdbxGetBothMdbxGetBothRangeMdbxGetCurrentMdbxGetMultipleMdbxLast MdbxLastDupMdbxNext MdbxNextDupMdbxNextMultiple MdbxNextNodupMdbxPrev MdbxPrevDup MdbxPrevNodupMdbxSet MdbxSetKey MdbxSetRangeMdbxPrevMultipleMdbxSetLowerbound MdbxCursor MdbxPutFlags MdbxUpsertMdbxNooverwrite MdbxNodupdata MdbxCurrent MdbxAlldups MdbxReserve MdbxAppend MdbxAppenddup MdbxMultipleMdbxValmvlSizemvlData MdbxDbFlagsMdbxDbDefaultsMdbxReversekey MdbxDupsortMdbxIntegerkey MdbxDupfixedMdbxIntegerdupMdbxReversedup MdbxCreate MdbxDbAccedeMdbxDbi MdbxTxnFlagsMdbxTxnReadwrite MdbxTxnNosync MdbxTxnRdonlyMdbxTxnNometasyncMdbxTxnRdonlyPrepare MdbxTxnTryMdbxTxn MdbxEnvMode MdbxEnvFlagsMdbxEnvDefaultsMdbxSyncDurable MdbxNosubdirMdbxSafeNosync MdbxMapasync MdbxRdonlyMdbxNometasync MdbxWritemapMdbxUtterlyNosync MdbxNotls MdbxExclusive MdbxNordahead MdbxNomeminit MdbxCoalesceMdbxLiforeclaimMdbxPageperturb MdbxAccedeMdbxEnv MdbxError MdbxKeyexistMdbxFirstLmdbErrcode MdbxNotfoundMdbxPageNotfound MdbxCorrupted MdbxPanicMdbxVersionMismatch MdbxInvalid MdbxMapFull MdbxDbsFullMdbxReadersFull MdbxTxnFullMdbxCursorFull MdbxPageFullMdbxUnableExtendMapsizeMdbxIncompatible MdbxBadRslot MdbxBadTxnMdbxBadValsize MdbxBadDbi MdbxProblemMdbxLastLmdbErrcodeMdbxBusyMdbxFirstAddedErrcode MdbxEmultival MdbxEbadsignMdbxWannaRecoveryMdbxEkeymismatch MdbxTooLargeMdbxThreadMismatchMdbxTxnOverlappingMdbxLastAddedErrcodeMdbxResultTrue MdbxSuccessMdbxResultFalse MdbxEperm MdbxEnofile MdbxEintrMdbxEio MdbxEnomem MdbxEaccess MdbxEremote MdbxEinval MdbxErofs MdbxEnosys MdbxEnodatamdbx_env_create mdbx_env_openmdbx_env_closemdbx_txn_beginmdbx_txn_commitmdbx_txn_abort mdbx_txn_env mdbx_dbi_openmdbx_dbi_close emptyMdbxValmdbx_putmdbx_getmdbx_delmdbx_cursor_openmdbx_cursor_closemdbx_cursor_delmdbx_cursor_getmdbx_cursor_putmdbx_cursor_count mdbx_strerrormdbx_cmp$fEnumMdbxError$fEnumMdbxEnvFlags$fEnumMdbxTxnFlags$fEnumMdbxDbFlags$fStorableMdbxVal$fEnumMdbxPutFlags$fShowMdbxCursorOp$fEqMdbxCursorOp$fOrdMdbxCursorOp$fEnumMdbxCursorOp$fShowMdbxPutFlags$fEqMdbxPutFlags$fOrdMdbxPutFlags $fEqMdbxVal $fShowMdbxVal$fShowMdbxDbFlags$fEqMdbxDbFlags$fOrdMdbxDbFlags$fShowMdbxTxnFlags$fEqMdbxTxnFlags$fOrdMdbxTxnFlags$fShowMdbxEnvFlags$fEqMdbxEnvFlags$fOrdMdbxEnvFlags$fShowMdbxError $fEqMdbxError$fOrdMdbxError$fStorableMdbxCursor$fStorableMdbxTxn$fStorableMdbxEnvkeyCmpenvOpenenvClosetxnBegin txnCommittxnAbortdbiOpendbiCloseitemGetitemPutitemDel cursorOpen cursorClose cursorPut cursorDel cursorFirst cursorLastcursorAt cursorRange cursorNext cursorPrev cursorMoveMdbxItem fromMdbxVal toMdbxVal$fMdbxItemTextgetItemgetItemsgetRangeputItemputItemsdelItemdelItems text-1.2.3.2Data.Text.InternalTextversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName