persistent-2.14.5.1: Type-safe, multi-backend data serialization.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Persist.SqlBackend.SqlPoolHooks

Synopsis

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:

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 #