HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulepg-entity-0.0.4.4Haskell2010

Database.PostgreSQL.Entity.DBT

The DBT plumbing module to handle database queries and pools

  • 1 type
  • 8 values
valuewithPool :: 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