fused-effects-squeal-0.1.0.0: A fused-effects adapter for squeal-postgresql.

Safe HaskellNone
LanguageHaskell2010

Control.Carrier.Squeal

Synopsis

Documentation

type DBConnection (schemas :: SchemasType) = K Connection schemas Source #

runSquealWithConn :: MonadUnliftIO m => DBConnection schemas -> Maybe TransactionMode -> (SquealException -> m k) -> SquealC schemas m k -> m k Source #

Run a squeal session using the given database connection, transaction mode and error handler.

runSquealWithConnRethrow :: MonadUnliftIO m => DBConnection schemas -> Maybe TransactionMode -> SquealC schemas m k -> m k Source #

Run a squeal session using the given database connection and transaction mode. Errors will not be handled.

runSquealWithConn' :: DBConnection schemas -> SquealC schemas m k -> m k Source #

Run a squeal session using the given database connection without a transaction and without any error handling. You probably shouldn't use this.

newtype SquealC schemas m k Source #

Constructors

SquealC 

Fields

Instances
(MonadUnliftIO m, Algebra sig m) => Algebra ((Squeal schemas :: (Type -> Type) -> Type -> Type) :+: sig) (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

alg :: (Squeal schemas :+: sig) (SquealC schemas m) a -> SquealC schemas m a #

Monad m => Monad (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

(>>=) :: SquealC schemas m a -> (a -> SquealC schemas m b) -> SquealC schemas m b #

(>>) :: SquealC schemas m a -> SquealC schemas m b -> SquealC schemas m b #

return :: a -> SquealC schemas m a #

fail :: String -> SquealC schemas m a #

Functor m => Functor (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

fmap :: (a -> b) -> SquealC schemas m a -> SquealC schemas m b #

(<$) :: a -> SquealC schemas m b -> SquealC schemas m a #

Applicative m => Applicative (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

pure :: a -> SquealC schemas m a #

(<*>) :: SquealC schemas m (a -> b) -> SquealC schemas m a -> SquealC schemas m b #

liftA2 :: (a -> b -> c) -> SquealC schemas m a -> SquealC schemas m b -> SquealC schemas m c #

(*>) :: SquealC schemas m a -> SquealC schemas m b -> SquealC schemas m b #

(<*) :: SquealC schemas m a -> SquealC schemas m b -> SquealC schemas m a #

MonadIO m => MonadIO (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

liftIO :: IO a -> SquealC schemas m a #

MonadUnliftIO m => MonadUnliftIO (SquealC schemas m) Source # 
Instance details

Defined in Control.Carrier.Squeal

Methods

askUnliftIO :: SquealC schemas m (UnliftIO (SquealC schemas m)) #

withRunInIO :: ((forall a. SquealC schemas m a -> IO a) -> IO b) -> SquealC schemas m b #

getSquealPool :: Has (SquealPool schemas) sig m => m (Pool (DBConnection schemas)) Source #

runSqueal' :: (MonadUnliftIO m, Has (SquealPool schemas) sig m) => SquealC schemas m k -> m k Source #

Run a squeal session picking a database connection from the connection pool without a transaction and without any error handling. You probably shouldn't use this.

runSqueal :: (MonadUnliftIO m, Has (SquealPool schemas) sig m) => Maybe TransactionMode -> (SquealException -> m k) -> SquealC schemas m k -> m k Source #

Run a squeal session picking a database connection from the connection pool with the given transaction mode and error handler.

runSquealPool :: Pool (DBConnection schemas) -> SquealPoolC schemas m k -> m k Source #

runSquealRethrow :: (MonadUnliftIO m, Has (SquealPool schemas) sig m) => Maybe TransactionMode -> SquealC schemas m k -> m k Source #

Run a squeal session picking a database connection from the connection pool with the given transaction mode. Errors will not be handled.