Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
- data DBRef mode a
- newDBRef :: Serialise k => Environment mode -> Database k a -> k -> IO (DBRef mode a)
- readDBRef :: Serialise a => DBRef mode a -> IO (Maybe a)
- writeDBRef :: Serialise a => DBRef ReadWrite a -> Maybe a -> IO ()
- modifyDBRef_ :: Serialise a => DBRef ReadWrite a -> (Maybe a -> Maybe a) -> IO ()
- modifyDBRef :: Serialise a => DBRef ReadWrite a -> (Maybe a -> (Maybe a, b)) -> IO b
Documentation
A DBRef
is a reference to a particular key within an LMDB database. It
may be empty (Nothing
) if the key does not currently exist in the
database, or it may contain a Just
value corresponding to the key.
A DBRef
may be ReadWrite
or ReadOnly
, depending on the environment
within which it is created. Note that ReadOnly
does not imply that the
contained value will not change, since the LMDB database could be modified
externally.
newDBRef :: Serialise k => Environment mode -> Database k a -> k -> IO (DBRef mode a) Source #
Create a new DBRef
for the given key and database within the given
environment.
writeDBRef :: Serialise a => DBRef ReadWrite a -> Maybe a -> IO () Source #
Write a new value into a DBRef
.