persistent-redis-2.13.0.2: Backend for persistent library using Redis.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Persist.Redis

Synopsis

Documentation

data RedisConf Source #

Information required to connect to a Redis server

Constructors

RedisConf 

Fields

class MonadRedis m => RedisCtx (m :: Type -> Type) (f :: Type -> Type) | m -> f #

This class captures the following behaviour: In a context m, a command will return its result wrapped in a "container" of type f.

Please refer to the Command Type Signatures section of this page for more information.

Minimal complete definition

returnDecode

Instances

Instances details
RedisCtx RedisTx Queued 
Instance details

Defined in Database.Redis.Transactions

RedisCtx Redis (Either Reply) 
Instance details

Defined in Database.Redis.Core

data Redis a #

Context for normal command execution, outside of transactions. Use runRedis to run actions of this type.

In this context, each result is wrapped in an Either to account for the possibility of Redis returning an Error reply.

Instances

Instances details
MonadFail Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

fail :: String -> Redis a #

MonadIO Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

liftIO :: IO a -> Redis a #

Applicative Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

pure :: a -> Redis a #

(<*>) :: Redis (a -> b) -> Redis a -> Redis b #

liftA2 :: (a -> b -> c) -> Redis a -> Redis b -> Redis c #

(*>) :: Redis a -> Redis b -> Redis b #

(<*) :: Redis a -> Redis b -> Redis a #

Functor Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

fmap :: (a -> b) -> Redis a -> Redis b #

(<$) :: a -> Redis b -> Redis a #

Monad Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

(>>=) :: Redis a -> (a -> Redis b) -> Redis b #

(>>) :: Redis a -> Redis b -> Redis b #

return :: a -> Redis a #

MonadRedis Redis 
Instance details

Defined in Database.Redis.Core

Methods

liftRedis :: Redis a -> Redis a #

MonadUnliftIO Redis 
Instance details

Defined in Database.Redis.Core.Internal

Methods

withRunInIO :: ((forall a. Redis a -> IO a) -> IO b) -> Redis b #

RedisCtx Redis (Either Reply) 
Instance details

Defined in Database.Redis.Core

data Connection #

A threadsafe pool of network connections to a Redis server. Use the connect function to create one.

Instances

Instances details
HasPersistBackend Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

Associated Types

type BaseBackend Connection #

PersistCore Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

Associated Types

data BackendKey Connection #

PersistStoreRead Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

Methods

get :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> ReaderT Connection m (Maybe record) #

getMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => [Key record] -> ReaderT Connection m (Map (Key record) record) #

PersistStoreWrite Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

Methods

insert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection, SafeToInsert record) => record -> ReaderT Connection m (Key record) #

insert_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection, SafeToInsert record) => record -> ReaderT Connection m () #

insertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection, SafeToInsert record) => [record] -> ReaderT Connection m [Key record] #

insertMany_ :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection, SafeToInsert record) => [record] -> ReaderT Connection m () #

insertEntityMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => [Entity record] -> ReaderT Connection m () #

insertKey :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> record -> ReaderT Connection m () #

repsert :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> record -> ReaderT Connection m () #

repsertMany :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => [(Key record, record)] -> ReaderT Connection m () #

replace :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> record -> ReaderT Connection m () #

delete :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> ReaderT Connection m () #

update :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> [Update record] -> ReaderT Connection m () #

updateGet :: forall record (m :: Type -> Type). (MonadIO m, PersistRecordBackend record Connection) => Key record -> [Update record] -> ReaderT Connection m record #

FromJSON (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

ToJSON (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

Read (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

Show (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

Eq (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

Ord (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

FromHttpApiData (BackendKey RedisBackend) Source # 
Instance details

Defined in Database.Persist.Redis.Store

ToHttpApiData (BackendKey RedisBackend) Source # 
Instance details

Defined in Database.Persist.Redis.Store

PathPiece (BackendKey RedisBackend) Source # 
Instance details

Defined in Database.Persist.Redis.Store

PersistField (BackendKey Connection) Source # 
Instance details

Defined in Database.Persist.Redis.Store

PersistFieldSql (BackendKey RedisBackend) Source # 
Instance details

Defined in Database.Persist.Redis.Store

newtype BackendKey Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

type BaseBackend Connection Source # 
Instance details

Defined in Database.Persist.Redis.Store

data PortID #

Instances

Instances details
FromJSON PortID Source # 
Instance details

Defined in Database.Persist.Redis.Config

Show PortID 
Instance details

Defined in Database.Redis.ConnectionContext

Eq PortID 
Instance details

Defined in Database.Redis.ConnectionContext

Methods

(==) :: PortID -> PortID -> Bool #

(/=) :: PortID -> PortID -> Bool #

type RedisT = ReaderT Connection Source #

Monad reader transformer keeping Redis connection through out the work

withRedisConn :: MonadIO m => RedisConf -> (Connection -> m a) -> m a Source #

Run a connection reader function against a Redis configuration

thisConnection :: Monad m => RedisT m Connection Source #

Extracts connection from RedisT monad transformer

execRedisT :: MonadIO m => RedisTx (Queued a) -> RedisT m a Source #

Execute Redis transaction inside RedisT monad transformer