Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- class Monad m => MonadSqlQuery m where
- runQueryRep :: Typeable record => SqlQueryRep record a -> m a
- withTransaction :: m a -> m a
Documentation
class Monad m => MonadSqlQuery m where Source #
The type-class for monads that can run persistent database queries.
runQueryRep :: Typeable record => SqlQueryRep record a -> m a Source #
The main function that interprets a SQL query operation and runs it in the monadic context.
withTransaction :: m a -> m a Source #
Run all queries in the given action using the same database connection.
You should make sure to not fork any threads within this action. This will almost certainly cause problems. https://github.com/brandonchinn178/persistent-mtl/issues/7