hasql-transaction-1.0.1.4: Composable abstraction over retryable transactions for Hasql
Safe HaskellNone
LanguageHaskell2010

Hasql.Transaction

Description

An API for declaration of transactions.

Synopsis

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

Instances details
Monad Transaction Source # 
Instance details

Defined in Hasql.Transaction.Private.Transaction

Functor Transaction Source # 
Instance details

Defined in Hasql.Transaction.Private.Transaction

Methods

fmap :: (a -> b) -> Transaction a -> Transaction b

(<$) :: a -> Transaction b -> Transaction a

Applicative Transaction Source # 
Instance details

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

Semigroup a => Semigroup (Transaction a) Source # 
Instance details

Defined in Hasql.Transaction.Private.Transaction

Methods

(<>) :: Transaction a -> Transaction a -> Transaction a

sconcat :: NonEmpty (Transaction a) -> Transaction a

stimes :: Integral b => b -> Transaction a -> Transaction a

Monoid a => Monoid (Transaction a) Source # 
Instance details

Defined in Hasql.Transaction.Private.Transaction

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.