HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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