| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.MonadArbiter
Synopsis
- class (Monad m, MonadIO m) => MonadArbiter (m :: Type -> Type) where
- type Handler (m :: Type -> Type) jobs result
- executeQuery :: Text -> Params -> RowCodec a -> m [a]
- executeStatement :: Text -> Params -> m Int64
- withDbTransaction :: m a -> m a
- runHandlerWithConnection :: Handler m jobs result -> jobs -> m result
- type Params = [SomeParam]
- data SomeParam where
- data ParamType a where
- type JobHandler (m :: Type -> Type) payload result = Handler m (JobRead payload) result
- type BatchedJobHandler (m :: Type -> Type) payload result = Handler m (NonEmpty (JobRead payload)) result
Documentation
class (Monad m, MonadIO m) => MonadArbiter (m :: Type -> Type) where Source #
Database abstraction for job queue operations. Each backend (postgresql-simple, hasql, orville) provides an instance that maps queries to its native driver.
Associated Types
type Handler (m :: Type -> Type) jobs result Source #
Backend-specific handler type (e.g., Connection -> jobs -> IO result).
Methods
executeQuery :: Text -> Params -> RowCodec a -> m [a] Source #
Run a parameterized query and decode the result rows.
executeStatement :: Text -> Params -> m Int64 Source #
Run a parameterized statement, returning the number of affected rows.
withDbTransaction :: m a -> m a Source #
Run an action in a transaction. Nesting creates savepoints.
runHandlerWithConnection :: Handler m jobs result -> jobs -> m result Source #
Run a handler with a database connection from the pool.
An existentially-typed parameter: a ParamType paired with its value.