persistent-mtl-0.4.0.0: Monad transformer for the persistent API
Safe HaskellNone
LanguageHaskell2010

Database.Persist.Monad.Class

Description

Defines the MonadSqlQuery type class that a monad can make an instance of in order to interpret how to run a SqlQueryRep sent by a lifted function from Database.Persist.Monad.Shim.

Synopsis

Documentation

class (Monad m, MonadSqlQuery (TransactionM m)) => MonadSqlQuery m where Source #

The type-class for monads that can run persistent database queries.

Associated Types

type TransactionM m :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> m a Source #

Interpret the given SQL query operation.

withTransaction :: TransactionM m a -> m a Source #

Run all queries in the given action using the same database connection.

Instances

Instances details
MonadSqlQuery m => MonadSqlQuery (MaybeT m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (MaybeT m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> MaybeT m a Source #

withTransaction :: TransactionM (MaybeT m) a -> MaybeT m a Source #

MonadUnliftIO m => MonadSqlQuery (SqlQueryT m) Source # 
Instance details

Defined in Database.Persist.Monad

Associated Types

type TransactionM (SqlQueryT m) :: Type -> Type Source #

(MonadSqlQuery m, MonadUnliftIO m) => MonadSqlQuery (SqlTransaction m) Source # 
Instance details

Defined in Database.Persist.Monad

Associated Types

type TransactionM (SqlTransaction m) :: Type -> Type Source #

MonadIO m => MonadSqlQuery (MockSqlQueryT m) Source # 
Instance details

Defined in Database.Persist.Monad.TestUtils

Associated Types

type TransactionM (MockSqlQueryT m) :: Type -> Type Source #

MonadSqlQuery m => MonadSqlQuery (IdentityT m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (IdentityT m) :: Type -> Type Source #

(Monoid w, MonadSqlQuery m) => MonadSqlQuery (WriterT w m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (WriterT w m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> WriterT w m a Source #

withTransaction :: TransactionM (WriterT w m) a -> WriterT w m a Source #

(Monoid w, MonadSqlQuery m) => MonadSqlQuery (WriterT w m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (WriterT w m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> WriterT w m a Source #

withTransaction :: TransactionM (WriterT w m) a -> WriterT w m a Source #

MonadSqlQuery m => MonadSqlQuery (StateT s m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (StateT s m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> StateT s m a Source #

withTransaction :: TransactionM (StateT s m) a -> StateT s m a Source #

MonadSqlQuery m => MonadSqlQuery (StateT s m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (StateT s m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> StateT s m a Source #

withTransaction :: TransactionM (StateT s m) a -> StateT s m a Source #

MonadSqlQuery m => MonadSqlQuery (ReaderT r m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (ReaderT r m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> ReaderT r m a Source #

withTransaction :: TransactionM (ReaderT r m) a -> ReaderT r m a Source #

MonadSqlQuery m => MonadSqlQuery (ExceptT e m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (ExceptT e m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> ExceptT e m a Source #

withTransaction :: TransactionM (ExceptT e m) a -> ExceptT e m a Source #

(Monoid w, MonadSqlQuery m) => MonadSqlQuery (RWST r w s m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (RWST r w s m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> RWST r w s m a Source #

withTransaction :: TransactionM (RWST r w s m) a -> RWST r w s m a Source #

(Monoid w, MonadSqlQuery m) => MonadSqlQuery (RWST r w s m) Source # 
Instance details

Defined in Database.Persist.Monad.Class

Associated Types

type TransactionM (RWST r w s m) :: Type -> Type Source #

Methods

runQueryRep :: Typeable record => SqlQueryRep record a -> RWST r w s m a Source #

withTransaction :: TransactionM (RWST r w s m) a -> RWST r w s m a Source #