Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SqlPoolHooks m backend
- defaultSqlPoolHooks :: ( MonadIO m, BackendCompatible SqlBackend backend) => SqlPoolHooks m backend
- getAlterBackend :: SqlPoolHooks m backend -> backend -> m backend
- modifyAlterBackend :: SqlPoolHooks m backend -> ((backend -> m backend) -> backend -> m backend) -> SqlPoolHooks m backend
- setAlterBackend :: SqlPoolHooks m backend -> (backend -> m backend) -> SqlPoolHooks m backend
- getRunBefore :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> m ()
- modifyRunBefore :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend
- setRunBefore :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend
- getRunAfter :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> m ()
- modifyRunAfter :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend
- setRunAfter :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend
- getRunOnException :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> SomeException -> m ()
Documentation
data SqlPoolHooks m backend Source #
A set of hooks that may be used to alter the behaviour
of
runSqlPoolWithExtensibleHooks
in a backwards-compatible
fashion.
defaultSqlPoolHooks :: ( MonadIO m, BackendCompatible SqlBackend backend) => SqlPoolHooks m backend Source #
Lifecycle hooks that may be altered to extend SQL pool behavior in a backwards compatible fashion.
By default, the hooks have the following semantics:
-
alterBackend
has no effect -
runBefore
begins a transaction -
runAfter
commits the current transaction -
runOnException
rolls back the current transaction
Since: 2.13.3.0
getAlterBackend :: SqlPoolHooks m backend -> backend -> m backend Source #
modifyAlterBackend :: SqlPoolHooks m backend -> ((backend -> m backend) -> backend -> m backend) -> SqlPoolHooks m backend Source #
setAlterBackend :: SqlPoolHooks m backend -> (backend -> m backend) -> SqlPoolHooks m backend Source #
getRunBefore :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> m () Source #
modifyRunBefore :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend Source #
setRunBefore :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend Source #
getRunAfter :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> m () Source #
modifyRunAfter :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend Source #
setRunAfter :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend Source #
getRunOnException :: SqlPoolHooks m backend -> backend -> Maybe IsolationLevel -> SomeException -> m () Source #