Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 Source #
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
condemn :: Transaction () Source #
Cause transaction to eventually roll back.
sql :: ByteString -> Transaction () Source #
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 Source #
Parameters and a specification of the parametric query to apply them to.