| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Orville.OrvilleDb
Contents
Description
A MonadArbiter transformer over the application's Orville monad:
import Arbiter.Core qualified as Arb
import Arbiter.Orville qualified as ArbO
import Orville.PostgreSQL qualified as O
O.withTransaction $ do
O.insertEntity ordersTable order
ArbO.runOrvilleDb @MyRegistry ArbO.OrvilleEnv {ArbO.schema = "arbiter", ArbO.listener = Nothing} $
Arb.insertJob (Arb.defaultJob (ProcessOrder orderId))
Queries run on the base monad's connection and join its open transaction.
Synopsis
- newtype OrvilleDb (registry :: JobPayloadRegistry) (m :: Type -> Type) a = OrvilleDb {
- unOrvilleDb :: ReaderT (OrvilleEnv registry) m a
- data OrvilleEnv (registry :: JobPayloadRegistry) = OrvilleEnv {}
- runOrvilleDb :: forall (registry :: JobPayloadRegistry) m a. OrvilleEnv registry -> OrvilleDb registry m a -> m a
- toOrvilleConnectionOptions :: ByteString -> PoolConfig -> ConnectionOptions
Database monad
newtype OrvilleDb (registry :: JobPayloadRegistry) (m :: Type -> Type) aSource #
The Orville database monad. Handlers run in the base monad.
Constructors
| OrvilleDb | |
Fields
| |
Instances
data OrvilleEnv (registry :: JobPayloadRegistry)Source #
The schema of the arbiter tables and an optional LISTEN/NOTIFY listener.
Constructors
| OrvilleEnv | |
runOrvilleDb :: forall (registry :: JobPayloadRegistry) m a. OrvilleEnv registry -> OrvilleDb registry m a -> m aSource #
Run an OrvilleDb action in the base monad.
Connection options
toOrvilleConnectionOptions :: ByteString -> PoolConfig -> ConnectionOptionsSource #
Arguments
| :: ByteString | PostgreSQL connection string |
| -> PoolConfig | Arbiter pool configuration |
| -> ConnectionOptions |
Orville ConnectionOptions from an arbiter PoolConfig.
Notice reporting is off.