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

Safe HaskellNone
LanguageHaskell2010

Lmdb.Connection

Synopsis

Documentation

withCursor :: Transaction e -> Database k v -> (Cursor e k v -> IO a) -> IO a Source #

openDatabase Source #

Arguments

:: ModeBool e 
=> Transaction e 
-> Maybe String

Database name

-> DatabaseSettings k v 
-> IO (Database k v) 

openMultiDatabase Source #

Arguments

:: ModeBool e 
=> Transaction e 
-> Maybe String

Database name

-> MultiDatabaseSettings k v 
-> IO (MultiDatabase k v) 

withDatabase :: ModeBool e => Environment e -> Transaction e -> Maybe String -> DatabaseSettings k v -> (Database k v -> IO a) -> IO a Source #

This should not normally be used.

withMultiDatabase :: ModeBool e => Environment e -> Transaction e -> Maybe String -> MultiDatabaseSettings k v -> (MultiDatabase k v -> IO a) -> IO a Source #

This should not normally be used.

initializeReadOnlyEnvironment Source #

Arguments

:: Int

Map size in bytes

-> Int

Maximum number of readers (recommended: 126)

-> Int

Maximum number of databases

-> FilePath

Directory for lmdb data and locks

-> IO (Environment ReadOnly) 

Internally, this calls mdb_env_create and mdb_env_open.

withReadOnlyEnvironment Source #

Arguments

:: Int

Map size in bytes

-> Int

Maximum number of readers (recommended: 126)

-> Int

Maximum number of databases

-> FilePath

Directory for lmdb data and locks

-> (Environment ReadOnly -> IO a)

Computation requiring an Environment

-> IO a 

initializeReadWriteEnvironment Source #

Arguments

:: Int

Map size in bytes

-> Int

Maximum number of readers (recommended: 126)

-> Int

Maximum number of databases

-> FilePath

Directory for lmdb data and locks

-> IO (Environment ReadWrite) 

Internally, this calls mdb_env_create and mdb_env_open.

initializeEnvironmentInternal Source #

Arguments

:: [MDB_EnvFlag]

Flags

-> Int

Map size in bytes

-> Int

Maximum number of readers (recommended: 126)

-> Int

Maximum number of databases

-> FilePath

Directory for lmdb data and locks

-> IO (Environment e) 

It is not clear whether or not it is actually neccessary to use runInBoundThread here. It is done just as an extra precaution.

makeSettings Source #

Arguments

:: Sort s k

Key sorting function

-> Codec s k

Key codec

-> Codec sv v

Value codec

-> DatabaseSettings k v 

makeMultiSettings Source #

Arguments

:: Sort sk k

Key sorting function

-> Sort sv v

Value sorting function

-> Codec sk k

Key codec

-> Codec sv v

Value codec

-> MultiDatabaseSettings k v