HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulepg-entity-0.0.6.0Haskell2010

Database.PostgreSQL.Entity.DBT

The DBT plumbing module to handle database queries and pools

  • 1 type
  • 8 values
newtypenewtype DBT (m :: Type -> Type) a
#
Instances11MonadTrans, Monad, Functor, MonadFail, Applicative, MonadIO, …
valuewithPool :: (HasCallStack, MonadIO m) => Pool Connection -> DBT IO a -> m a
#

Run a DBT action with no explicit error handling.

This functions is suited for using MonadError error handling.

Example
let e1 = E 1 True True
result <- runExceptT @EntityError $ do
  withPool pool $ insertEntity e1
  withPool pool $ markForProcessing 1
case result of
  Left err -> print err
  Right _  -> putStrLn "Everything went well"

See the code in the example/ directory on GitHub