C      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None+>Error codes from MDB. Note, however, that this API for MDB will mostly use exceptions for any non-successful return codes. This is mostly included because I feel the binding would be incomplete otherwise.+(The MDB_SUCCESS return value is excluded.)'compiled write flags, corresponding to a [WriteFlag] list. Used because writes are frequent enough that we want to avoid building from a list on a per-write basis.6Environment flags from lmdb.h:Note: MDB_NOTLS is implicit and enforced for this binding.OA value stored in the database. Be cautious; committing the transaction that obtained a value should also invalidate it; avoid capturing MDB_val in a lazy value. A safe@ interface similar to STRef will be provided in another module.RXOpaque structure for a cursor on an MDB_dbi' object. Cursors in this case also use the unsafe FFI calls.S)Handle for a database in the environment."This variation is associated with unsafe| FFI calls, with reduced overhead but no user-defined comparisons. I expect most code using LMDB could use this variation.T!Opaque structure for LMDB cursor.U)Handle for a database in the environment.VIdentifier for a transaction.W&Opaque structure for LMDB transaction.X&Opaque structure for LMDB environment.The environment additionally contains an MVar to enforce at most one lightweight Haskell thread is writing at a time. This is necessary so long as LMDB uses a long-lived mutex for writes, as in v0.9.10.YLMDB_Error is the exception type thrown in case a function from the LMDB API does not return successfully. Clients should be prepared to catch exceptions from any LMDB operation.^Version information for LMDB. Two potentially different versions can be obtained: lmdb_version returns the version at the time of binding (via C preprocessor macros) and lmdb_dyn_version returns a version for the bound library.These bindings to Haskell will refuse to open the database when the dynamic version of LMDB is different in the major or minor fields.d,User-defined comparison functions for keys. f;Version of LMDB when the Haskell-LMDB binding was compiled.g6Version of LMDB linked to the current Haskell process.hcompile a list of write flags. iBAllocate an environment object. This doesn't open the environment./After creation, but before opening, please use:Dmdb_env_set_mapsize mdb_env_set_maxreaders mdb_env_set_maxdbsYThen, just after opening, you should create all the databases your application will use. In addition to normal LMDB errors, this operation may throw an MDB_VERSION_MISMATCH if the Haskell LMDB bindings doesn't match the dynamic version. If this happens, you'll need to rebuild the lmdb Haskell package, and ensure your lmdb-dev libraries are up to date. jopen or build a database in the filesystem. The named directory must already exist and be writeable. Before opening, be sure to at least apply u.=After opening the environment, you should open the databases:Create the environment. Open a transaction. Open all DBI handles the app will need. Commit the transaction. Use those DBI handles in subsequent transactionsk:Copy the environment to an empty (but existing) directory.Note: the LMDB copy operation temporarily grabs the writer mutex. Unfortunately, this greatly complicates the binding to Haskell. This interface, mdb_env_copy, conservatively blocks all writers in the same process for the entire duration of copy. _Recommendation: Don't use this function in the same process with writers. Consider use of the mdb_copy. command line utility if you need hot copies.l!obtain statistics for environmentm0obtain ad-hoc information about the environment.nInitiate synchronization of environment with disk. However, if the MDB_NOSYNC or MDB_MAPASYNC flags are active, this won't wait for the operation to finish. Cf. mdb_env_sync_flush.o/Force buffered writes to disk before returning.phClose the environment. The MDB_env object should not be used by any operations during or after closing.qSet flags for the environment.r Unset flags for the environment.s2View the current set of flags for the environment.t,Obtain filesystem path for this environment.uSet the memory map size, in bytes, for this environment. This determines the maximum size for the environment and databases, but typically only a small fraction of the database is in memory at any given moment. It is not a problem to set this to a very large number, hundreds of gigabytes or even terabytes, assuming a sufficiently large address space. It should be set to a multiple of page size.dThe default map size is 1MB, intentionally set low to force developers to select something larger.v-Set the maximum number of concurrent readers.w-Get the maximum number of concurrent readers.xfSet the maximum number of named databases. LMDB is designed to support a small handful of databases. yyKey sizes in LMDB are determined by a compile-time constant, defaulting to 511 bytes. This function returns the maximum.zDCheck for stale readers, and return number of stale readers cleared.{;Dump entries from reader lock table (for human consumption)|DBegin a new transaction, possibly read-only, with a possible parent."mdb_txn_begin env parent bReadOnly[A read-write transaction should be tethered to a specific Haskell thread, which MUST be a boundY thread (via forkOS or runInBoundThread). A read only transaction is not so constrained.The hierarchical transactions are useful for read-write transactions. They allow trying something out then aborting if it doesn't work. But only one child should be active at a time, all in the same OS thread.An attempt to grab a writer transaction may block, potentially for a very long time. It's the responsibility of the software architects to ensure there is no need for long-running write operations.}%Access environment for a transaction.~;Commit a transaction. Don't use the transaction after this.:Abort a transaction. Don't use the transaction after this.qOpen a database that supports user-defined comparisons, but has slightly more FFI overhead for reads and writes.7LMDB supports a small set of named databases, plus one main9 database using the null argument for the database name.database statisticsreview flags from databaseclose the database handle.Note: the normal use-case for LMDB is to open all the database handles up front, then hold onto them until the application is closed or crashed. In that case, you don't need to bother with closing database handles.Gremove the database and close the handle; don't use MDB_dbi after this*clear contents of database, reset to empty:Set a user-defined key comparison function for a database.FSet a user-defined data comparison operator for MDB_DUPSORT databases.?Access a value by key. Returns Nothing if the key is not found.'Add a (key,value) pair to the database.iReturns False on MDB_KEYEXIST, and True on MDB_SUCCESS. Any other return value results in an exception. Allocate space for data under a given key. This space must be filled before the write transaction commits. The idea here is to avoid an extra allocation.'mdb_reserve flags txn dbi key byteCount]Note: not safe to use with MDB_DUPSORT. Note: MDB_KEYEXIST will result in an exception here.Delete a given key, or a specific (key,value) pair in case of MDB_DUPSORT. This function will return False on a MDB_NOTFOUND result.Note: Ideally, LMDB would match the value even without MDB_DUPSORT. But it doesn't. Under the hood, the data is replaced by a null ptr if MDB_DUPSORT is not enabled (v0.9.10).(compare two values as keys in a database5compare two values as data in an MDB_DUPSORT databaseopen a cursor for the database.Low-level mdb_cursor_get operation, with direct control of how pointers to values are allocated, whether an argument is a nullPtr, and so on.In this case, False is returned for MDB_NOTFOUND (in which case the cursor should not be moved), and True is returned for MDB_SUCCESS. Depending on the MDB_cursor_op, additional values may be returned via the pointers.  Low-level  operation.qAs with mdb_put, this returns True on MDB_SUCCESS and False for MDB_KEYEXIST, and otherwise throws an exception. Delete the value at the cursor. Close a cursor. don't use after this. In general, cursors should be closed before their associated transaction is commited or aborted.,Access transaction associated with a cursor.-Access the database associated with a cursor.Bcount number of duplicate data items at cursor's current location.,  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh     ijklmnopqrstuvwxyz{|}~ !"#$%&'()*+  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^_`abcfgYZ[\] XUSWVTROPQPQHIJKLMNIJKLMNABCDEFGBCDEFGde6@?>=<;:987.543210/&%$#"! (-,+*)'hijklmnopqrstuvwxy|}~{z &%$#"! '(-,+*).543210/6 @?>=<;:987ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh     ijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[[\]^__`abcdefghijklmnopqrstuvwxyz{|}~)CJQTUVWXYZ      ! lmdb-0.2.0Database.LMDB.Raw MDB_ErrCodeMDB_BAD_VALSIZE MDB_BAD_TXN MDB_BAD_RSLOTMDB_INCOMPATIBLEMDB_MAP_RESIZED MDB_PAGE_FULLMDB_CURSOR_FULL MDB_TXN_FULL MDB_TLS_FULLMDB_READERS_FULL MDB_DBS_FULL MDB_MAP_FULL MDB_INVALIDMDB_VERSION_MISMATCH MDB_PANIC MDB_CORRUPTEDMDB_PAGE_NOTFOUND MDB_NOTFOUND MDB_KEYEXIST MDB_cursor_op MDB_SET_RANGE MDB_SET_KEYMDB_SETMDB_PREV_NODUP MDB_PREV_DUPMDB_PREVMDB_NEXT_NODUPMDB_NEXT_MULTIPLE MDB_NEXT_DUPMDB_NEXT MDB_LAST_DUPMDB_LASTMDB_GET_MULTIPLEMDB_GET_CURRENTMDB_GET_BOTH_RANGE MDB_GET_BOTH MDB_FIRST_DUP MDB_FIRSTMDB_WriteFlags MDB_WriteFlag MDB_APPENDDUP MDB_APPEND MDB_CURRENT MDB_NODUPDATAMDB_NOOVERWRITE MDB_DbFlag MDB_CREATEMDB_REVERSEDUPMDB_INTEGERDUP MDB_DUPFIXEDMDB_INTEGERKEY MDB_DUPSORTMDB_REVERSEKEY MDB_EnvFlag MDB_NOMEMINIT MDB_NORDAHEAD MDB_NOLOCK MDB_MAPASYNC MDB_WRITEMAPMDB_NOMETASYNC MDB_RDONLY MDB_NOSYNC MDB_NOSUBDIR MDB_FIXEDMAP MDB_envinfo me_mapaddr me_mapsize me_last_pgno me_last_txnid me_maxreaders me_numreadersMDB_statms_psizems_depthms_branch_pages ms_leaf_pagesms_overflow_pages ms_entriesMDB_valmv_sizemv_data MDB_cursor'MDB_dbi' MDB_cursorMDB_dbi MDB_txnidMDB_txnMDB_env LMDB_Error e_context e_descriptione_code LMDB_Versionv_majorv_minorv_patchv_text MDB_cmp_func wrapCmpFn lmdb_versionlmdb_dyn_versioncompileWriteFlagsmdb_env_create mdb_env_open mdb_env_copy mdb_env_stat mdb_env_info mdb_env_syncmdb_env_sync_flush mdb_env_closemdb_env_set_flagsmdb_env_unset_flagsmdb_env_get_flagsmdb_env_get_pathmdb_env_set_mapsizemdb_env_set_maxreadersmdb_env_get_maxreadersmdb_env_set_maxdbsmdb_env_get_maxkeysizemdb_reader_checkmdb_reader_list mdb_txn_begin mdb_txn_envmdb_txn_commit mdb_txn_abort mdb_dbi_openmdb_stat mdb_dbi_flags mdb_dbi_closemdb_drop mdb_clear mdb_dbi_open' mdb_stat'mdb_dbi_flags'mdb_dbi_close' mdb_drop' mdb_clear'mdb_set_comparemdb_set_dupsortmdb_getmdb_put mdb_reservemdb_delmdb_get'mdb_put' mdb_reserve'mdb_del'mdb_cmpmdb_dcmpmdb_cmp' mdb_dcmp'mdb_cursor_openmdb_cursor_open'mdb_cursor_getmdb_cursor_get'mdb_cursor_putmdb_cursor_put'mdb_cursor_delmdb_cursor_del'mdb_cursor_closemdb_cursor_close'mdb_cursor_txnmdb_cursor_txn'mdb_cursor_dbimdb_cursor_dbi'mdb_cursor_countmdb_cursor_count' MDB_txnid_t MDB_dbi_t MDB_mode_t _crs_ptr' _crs_dbi' _crs_txn'_dbi'_crs_ptr_crs_dbi_crs_txn_dbi_txnid_txn_ptr_txn_env_txn_rw_txn_p_env_ptr _env_wlock MDB_msg_func wrapMsgFunc_mdb_reader_check_mdb_reader_list_mdb_cursor_count'_mdb_cursor_del'_mdb_cursor_put'_mdb_cursor_get'_mdb_cursor_close'_mdb_cursor_open'_mdb_cursor_count_mdb_cursor_del_mdb_cursor_put_mdb_cursor_get_mdb_cursor_close_mdb_cursor_open _mdb_del' _mdb_put' _mdb_get'_mdb_del_mdb_put_mdb_get _mdb_dcmp' _mdb_cmp' _mdb_dcmp_mdb_cmp_mdb_set_dupsort_mdb_set_compare _mdb_drop_mdb_dbi_close_mdb_dbi_flags _mdb_stat _mdb_dbi_open_mdb_txn_abort_mdb_txn_commit_mdb_txn_begin_mdb_env_get_maxkeysize_mdb_env_set_maxdbs_mdb_env_get_maxreaders_mdb_env_set_maxreaders_mdb_env_set_mapsize_mdb_env_get_path_mdb_env_get_flags_mdb_env_set_flags_mdb_env_close _mdb_env_sync _mdb_env_info _mdb_env_stat _mdb_env_copy _mdb_env_open_mdb_env_create _mdb_strerror _mdb_version _peekCInt _peekCUIntenvFlags envFlagsArraycompileEnvFlagsdecompileBitFlagsdecompileEnvFlagsdbFlags dbFlagsArraycompileDBFlagsdecompileDBFlags writeFlagswriteFlagsArray cursorOpscursorOpsArraycursorOperrCodes _numToErrVal_throwLMDBErrNumlmdb_validate_version_match versionMatch withMsgFunc_lockErr _unlockErr_lockEnv _unlockEnv _unlockTxnmdb_dbi_open_t mdb_stat_tmdb_dbi_flags_tmdb_dbi_close_t mdb_drop_t mdb_clear_tzedr_get withKVPtrsr_put wfReserve reserveDatar_del r_cursor_get r_cursor_put r_cursor_del _peekSize$fStorableMDB_envinfo$fStorableMDB_stat$fStorableMDB_val$fExceptionLMDB_Error