| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Simple.MonadArbiter
Contents
Description
MonadArbiter primitives backed by postgresql-simple.
Synopsis
- class Monad m => HasSimplePool (m :: Type -> Type) where
- getSimplePool :: m SimpleConnectionPool
- localSimplePool :: (SimpleConnectionPool -> SimpleConnectionPool) -> m a -> m a
- data SimpleConnectionPool = SimpleConnectionPool {}
- simpleExecuteQuery :: (HasSimplePool m, MonadUnliftIO m) => Query a -> m [a]
- simpleExecuteStatement :: (HasSimplePool m, MonadUnliftIO m) => Query a -> m Int64
- simpleWithDbTransaction :: (HasSimplePool m, MonadUnliftIO m) => m a -> m a
- simpleWithConnection :: (HasSimplePool m, MonadUnliftIO m) => m a -> m a
- simpleRunHandlerWithConnection :: (HasSimplePool m, MonadUnliftIO m) => (Connection -> job -> m result) -> job -> m result
Documentation
Source #class Monad m => HasSimplePool (m :: Type -> Type) where
Ambient access to the connection pool.
Methods
Source #getSimplePool :: m SimpleConnectionPool
Source #localSimplePool :: (SimpleConnectionPool -> SimpleConnectionPool) -> m a -> m a
Instances
| Monad m => HasSimplePool (SimpleDb registry m) Source # | |
Defined in Arbiter.Simple.SimpleDb Methods Source #getSimplePool :: SimpleDb registry m SimpleConnectionPool Source #localSimplePool :: (SimpleConnectionPool -> SimpleConnectionPool) -> SimpleDb registry m a -> SimpleDb registry m a | |
Source #data SimpleConnectionPool
Pool, pinned connection, and savepoint depth.
Constructors
| SimpleConnectionPool | |
Fields | |
MonadArbiter implementation
Source #simpleExecuteQuery :: (HasSimplePool m, MonadUnliftIO m) => Query a -> m [a]
Run a query, decoding rows.
Source #simpleExecuteStatement :: (HasSimplePool m, MonadUnliftIO m) => Query a -> m Int64
Run a statement, returning rows affected.
Source #simpleWithDbTransaction :: (HasSimplePool m, MonadUnliftIO m) => m a -> m a
Transaction bracket. Nests via savepoints.
Source #simpleWithConnection :: (HasSimplePool m, MonadUnliftIO m) => m a -> m a
Pin one pooled connection for the action.
Source #simpleRunHandlerWithConnection :: (HasSimplePool m, MonadUnliftIO m) => (Connection -> job -> m result) -> job -> m result
Run a handler on the pinned connection.