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

Database.Persist.SqlBackend.Internal.SqlPoolHooks

Synopsis

Documentation

data SqlPoolHooks (m :: Type -> Type) backend Source #

A set of hooks that may be used to alter the behaviour of runSqlPoolWithExtensibleHooks in a backwards-compatible fashion.

Constructors

SqlPoolHooks 

Fields

  • alterBackend :: backend -> m backend

    Alter the backend prior to executing any actions with it.

  • runBefore :: backend -> Maybe IsolationLevel -> m ()

    Run this action immediately before the action is performed.

  • runAfter :: backend -> Maybe IsolationLevel -> m ()

    Run this action immediately after the action is completed.

  • runOnException :: backend -> Maybe IsolationLevel -> SomeException -> m ()

    This action is performed when an exception is received. The exception is provided as a convenience - it is rethrown once this cleanup function is complete.