hpqtypes
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Transaction

Synopsis

Documentation

newtype Savepoint Source #

Wrapper that represents savepoint name.

Constructors

Savepoint (RawSQL ()) 

Instances

Instances details
IsString Savepoint Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Transaction

withSavepoint :: (HasCallStack, MonadDB m, MonadMask m) => Savepoint -> m a -> m a Source #

Create a savepoint and roll back to it if given monadic action throws. This may only be used if a transaction is already active. Note that it provides something like "nested transaction".

See http://www.postgresql.org/docs/current/static/sql-savepoint.html

begin :: (HasCallStack, MonadDB m, MonadMask m) => m () Source #

Begin transaction using given transaction settings.

commit :: (HasCallStack, MonadDB m, MonadMask m) => m () Source #

Commit active transaction using given transaction settings.

rollback :: (HasCallStack, MonadDB m, MonadMask m) => m () Source #

Rollback active transaction using given transaction settings.

unsafeWithoutTransaction :: (HasCallStack, MonadDB m, MonadMask m) => m a -> m a Source #

Run a block of code without an open transaction.

This function is unsafe, because if there is a transaction in progress, it's commited, so the atomicity guarantee is lost.