| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasql.Transaction
Contents
Description
An API for declaration of transactions.
Synopsis
- data Transaction a
- condemn :: Transaction ()
- sql :: ByteString -> Transaction ()
- statement :: a -> Statement a b -> Transaction b
Transaction monad
data Transaction a #
A composable abstraction over the retryable transactions.
Executes multiple queries under the specified mode and isolation level,
while automatically retrying the transaction in case of conflicts.
Thus this abstraction closely reproduces the behaviour of STM.
Instances
| Monad Transaction # | |
Defined in Hasql.Transaction.Private.Transaction Methods (>>=) :: Transaction a -> (a -> Transaction b) -> Transaction b # (>>) :: Transaction a -> Transaction b -> Transaction b # return :: a -> Transaction a # fail :: String -> Transaction a # | |
| Functor Transaction # | |
Defined in Hasql.Transaction.Private.Transaction Methods fmap :: (a -> b) -> Transaction a -> Transaction b # (<$) :: a -> Transaction b -> Transaction a # | |
| Applicative Transaction # | |
Defined in Hasql.Transaction.Private.Transaction Methods pure :: a -> Transaction a # (<*>) :: Transaction (a -> b) -> Transaction a -> Transaction b # liftA2 :: (a -> b -> c) -> Transaction a -> Transaction b -> Transaction c # (*>) :: Transaction a -> Transaction b -> Transaction b # (<*) :: Transaction a -> Transaction b -> Transaction a # | |
condemn :: Transaction () #
Cause transaction to eventually roll back.
sql :: ByteString -> Transaction () #
Possibly a multi-statement query, which however cannot be parameterized or prepared, nor can any results of it be collected.
statement :: a -> Statement a b -> Transaction b #
Parameters and a specification of the parametric query to apply them to.