lmdb 0.2.1 → 0.2.2
raw patch · 2 files changed
+21/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Database.LMDB.Raw: mdb_txn_renew :: MDB_txn -> IO ()
+ Database.LMDB.Raw: mdb_txn_reset :: MDB_txn -> IO ()
Files
- hsrc_lib/Database/LMDB/Raw.hsc +20/−3
- lmdb.cabal +1/−1
hsrc_lib/Database/LMDB/Raw.hsc view
@@ -32,7 +32,6 @@ -- -- * functions directly using file handles -- * user-defined relocation functions --- * alloc-avoiding renew and reset operations -- * MDB_MULTIPLE is not currently supported (todo) -- module Database.LMDB.Raw@@ -123,6 +122,9 @@ , mdb_reader_list , mdb_reader_check + , mdb_txn_reset+ , mdb_txn_renew+ -- | Utility , withKVPtrs , withKVOptPtrs@@ -218,6 +220,9 @@ -- foreign import ccall unsafe "lmdb.h mdb_cursor_txn" _mdb_cursor_txn' :: Ptr MDB_cursor -> IO (Ptr MDB_txn) -- foreign import ccall unsafe "lmdb.h mdb_cursor_dbi" _mdb_cursor_dbi' :: Ptr MDB_cursor -> IO MDB_dbi +foreign import ccall unsafe "lmdb.h mdb_txn_reset" _mdb_txn_reset :: Ptr MDB_txn -> IO ()+foreign import ccall "lmdb.h mdb_txn_renew" _mdb_txn_renew :: Ptr MDB_txn -> IO CInt+ foreign import ccall "lmdb.h mdb_reader_list" _mdb_reader_list :: Ptr MDB_env -> FunPtr MDB_msg_func -> Ptr () -> IO CInt foreign import ccall "lmdb.h mdb_reader_check" _mdb_reader_check :: Ptr MDB_env -> Ptr CInt -> IO CInt @@ -346,8 +351,8 @@ -- | A 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.+-- avoid capturing MDB_val in a lazy value. A safe interface+-- similar to STRef could be provided by another module. data MDB_val = MDB_val { mv_size :: {-# UNPACK #-} !CSize , mv_data :: {-# UNPACK #-} !(Ptr Word8)@@ -915,6 +920,18 @@ mdb_txn_abort txn = mask_ $ _mdb_txn_abort (_txn_ptr txn) >> _unlockTxn txn++-- | Abort a read-only transaction, but don't destroy it. +-- Keep it available for mdb_txn_renew.+mdb_txn_reset :: MDB_txn -> IO ()+mdb_txn_reset txn = _mdb_txn_reset (_txn_ptr txn) ++-- | Renew a read-only transaction that was previously _reset.+mdb_txn_renew :: MDB_txn -> IO ()+mdb_txn_renew txn =+ _mdb_txn_renew (_txn_ptr txn) >>= \ rc ->+ unless (0 == rc) (_throwLMDBErrNum "mdb_txn_renew" rc)+ {-
lmdb.cabal view
@@ -1,5 +1,5 @@ Name: lmdb-Version: 0.2.1+Version: 0.2.2 Synopsis: Lightning MDB bindings Category: Database Description: