| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.PostgreSQL.PQTypes.Transaction
Synopsis
- newtype Savepoint = Savepoint (RawSQL ())
- withSavepoint :: (HasCallStack, MonadDB m, MonadMask m) => Savepoint -> m a -> m a
- begin :: (HasCallStack, MonadDB m, MonadMask m) => m ()
- commit :: (HasCallStack, MonadDB m, MonadMask m) => m ()
- rollback :: (HasCallStack, MonadDB m, MonadMask m) => m ()
- unsafeWithoutTransaction :: (HasCallStack, MonadDB m, MonadMask m) => m a -> m a
Documentation
Wrapper that represents savepoint name.
Instances
| IsString Savepoint Source # | |
Defined in Database.PostgreSQL.PQTypes.Transaction Methods fromString :: String -> Savepoint # | |
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.