Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- openLiszt :: MonadIO m => FilePath -> m LisztHandle
- closeLiszt :: MonadIO m => LisztHandle -> m ()
- withLiszt :: (MonadIO m, MonadMask m) => FilePath -> (LisztHandle -> m a) -> m a
- data LisztHandle
- type Key = ByteString
- type Tag = Encoding
- type Transaction = StateT TransactionState IO
- clear :: Key -> Transaction ()
- insert :: Serialise a => Key -> a -> Transaction ()
- insertTagged :: (Serialise t, Serialise a) => Key -> t -> a -> Transaction ()
- insertRaw :: Key -> Tag -> Encoding -> Transaction ()
- commit :: MonadIO m => LisztHandle -> Transaction a -> m a
- commitFile :: FilePath -> Transaction a -> IO a
- data Offset
- data Request = Request {}
- defRequest :: Key -> Request
- data Connection
- withConnection :: String -> Int -> ByteString -> (Connection -> IO r) -> IO r
- fetch :: Connection -> Request -> IO [(Int, ByteString, ByteString)]
Documentation
closeLiszt :: MonadIO m => LisztHandle -> m () Source #
data LisztHandle Source #
Writer interface
type Key = ByteString Source #
Tag is an extra value attached to a payload. This can be used to perform a binary search.
type Transaction = StateT TransactionState IO Source #
clear :: Key -> Transaction () Source #
Replace the specified key with an empty list.
insertTagged :: (Serialise t, Serialise a) => Key -> t -> a -> Transaction () Source #
Insert a value with a tag (e.g. timestamp).
Tags can be used to perform WineryTag
query.
Tag values should be monotonically increasing but this is not checked.
commit :: MonadIO m => LisztHandle -> Transaction a -> m a Source #
commitFile :: FilePath -> Transaction a -> IO a Source #
Commit a Transaction
to a file.
Reader
Instances
Instances
Show Request Source # | |
Generic Request Source # | |
Serialise Request Source # | |
Defined in Database.Liszt.Tracker schemaVia :: Proxy Request -> [TypeRep] -> Schema # toEncoding :: Request -> Encoding # | |
type Rep Request Source # | |
Defined in Database.Liszt.Tracker type Rep Request = D1 (MetaData "Request" "Database.Liszt.Tracker" "liszt-0.1-1cOiQgJXwtqKFMyn5HpvuM" False) (C1 (MetaCons "Request" PrefixI True) ((S1 (MetaSel (Just "reqKey") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Key) :*: S1 (MetaSel (Just "reqTimeout") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) :*: (S1 (MetaSel (Just "reqLimit") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: (S1 (MetaSel (Just "reqFrom") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Offset) :*: S1 (MetaSel (Just "reqTo") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Offset))))) |
defRequest :: Key -> Request Source #
data Connection Source #
withConnection :: String -> Int -> ByteString -> (Connection -> IO r) -> IO r Source #
fetch :: Connection -> Request -> IO [(Int, ByteString, ByteString)] Source #