ouroboros-consensus-0.26.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB.Bridge

Description

Alternatives to LMDB operations that do not rely on Serialise instances

We cannot (easily and without runtime overhead) satisfy the Serialise constraints that the lmdb-simple operations require. We have access to the codification and decodification functions provided in CodecMK, thus, we redefine parts of the internal LMDB.Simple operations here. The redefinitions are largely analogous to their counterparts, though they thread through explicit CBOR encoders and decoders.

Synopsis

Cursor

fromCodecMK ∷ (IndexedMemPack idx v, MemPack k) ⇒ idx → PeekPoke k v Source #

runCursorAsTransaction' ∷ ∀ k idx v (mode ∷ Mode) a. (MemPack k, IndexedMemPack idx v) ⇒ idx → CursorM k v mode a → Database k v → Transaction mode a Source #

Wrapper around runCursorAsTransaction' that requires a CodecMK instead of a PeekPoke.

Internal: get and put

get ∷ ∀ k v (mode ∷ Mode). (MemPack k, MemPack v) ⇒ Database k v → k → Transaction mode (Maybe v) Source #

getBS ∷ ∀ v k (mode ∷ Mode). MemPack v ⇒ Database k v → ByteStringTransaction mode (Maybe v) Source #

getBS' ∷ ∀ k v (mode ∷ Mode). Database k v → ByteStringTransaction mode (Maybe MDB_val) Source #

indexedGet ∷ ∀ idx v k (mode ∷ Mode). (IndexedMemPack idx v, MemPack k) ⇒ idx → Database k v → k → Transaction mode (Maybe v) Source #

indexedPut ∷ (IndexedMemPack idx v, MemPack k) ⇒ idx → Database k v → k → v → Transaction 'ReadWrite () Source #

put ∷ (MemPack v, MemPack k) ⇒ Database k v → k → v → Transaction 'ReadWrite () Source #

putBSMemPack v ⇒ Database k v → ByteString → v → Transaction 'ReadWrite () Source #

Orphan instances

Buffer MDB_val Source # 
Instance details

Methods

bufferByteCountMDB_valInt Source #

bufferMDB_val → (ByteArray# → a) → (Addr# → a) → a Source #