psql-0.0.0: PostgreSQL client
Safe HaskellNone
LanguageHaskell2010

PostgreSQL.ConnectionPool

Description

This module defines an interpreter for RunQuery.

Synopsis

Documentation

newtype ConnectionPoolT m a Source #

Interpreter for RunQuery which dispatches queries to a pool of database connections

Since: 0.0.0

Constructors

ConnectionPoolT 

Fields

Instances

Instances details
MonadTrans ConnectionPoolT Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

lift :: Monad m => m a -> ConnectionPoolT m a #

MonadWriter w m => MonadWriter w (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

writer :: (a, w) -> ConnectionPoolT m a #

tell :: w -> ConnectionPoolT m () #

listen :: ConnectionPoolT m a -> ConnectionPoolT m (a, w) #

pass :: ConnectionPoolT m (a, w -> w) -> ConnectionPoolT m a #

MonadState s m => MonadState s (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

get :: ConnectionPoolT m s #

put :: s -> ConnectionPoolT m () #

state :: (s -> (a, s)) -> ConnectionPoolT m a #

MonadError e m => MonadError e (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Monad m => Monad (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Functor m => Functor (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

fmap :: (a -> b) -> ConnectionPoolT m a -> ConnectionPoolT m b #

(<$) :: a -> ConnectionPoolT m b -> ConnectionPoolT m a #

MonadFail m => MonadFail (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

fail :: String -> ConnectionPoolT m a #

Applicative m => Applicative (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

MonadIO m => MonadIO (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

liftIO :: IO a -> ConnectionPoolT m a #

MonadThrow m => MonadThrow (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

throwM :: Exception e => e -> ConnectionPoolT m a #

MonadCatch m => MonadCatch (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

catch :: Exception e => ConnectionPoolT m a -> (e -> ConnectionPoolT m a) -> ConnectionPoolT m a #

MonadMask m => MonadMask (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Methods

mask :: ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m b) -> ConnectionPoolT m b #

uninterruptibleMask :: ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m b) -> ConnectionPoolT m b #

generalBracket :: ConnectionPoolT m a -> (a -> ExitCase b -> ConnectionPoolT m c) -> (a -> ConnectionPoolT m b) -> ConnectionPoolT m (b, c) #

MonadConc m => MonadConc (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

Associated Types

type STM (ConnectionPoolT m) :: Type -> Type

type MVar (ConnectionPoolT m) :: Type -> Type

type IORef (ConnectionPoolT m) :: Type -> Type

type Ticket (ConnectionPoolT m) :: Type -> Type

type ThreadId (ConnectionPoolT m)

Methods

forkWithUnmask :: ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

forkWithUnmaskN :: String -> ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

forkOnWithUnmask :: Int -> ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

forkOnWithUnmaskN :: String -> Int -> ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

forkOSWithUnmask :: ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

forkOSWithUnmaskN :: String -> ((forall a. ConnectionPoolT m a -> ConnectionPoolT m a) -> ConnectionPoolT m ()) -> ConnectionPoolT m (ThreadId (ConnectionPoolT m))

supportsBoundThreads :: ConnectionPoolT m Bool

isCurrentThreadBound :: ConnectionPoolT m Bool

getNumCapabilities :: ConnectionPoolT m Int

setNumCapabilities :: Int -> ConnectionPoolT m ()

myThreadId :: ConnectionPoolT m (ThreadId (ConnectionPoolT m))

yield :: ConnectionPoolT m ()

threadDelay :: Int -> ConnectionPoolT m ()

newEmptyMVar :: ConnectionPoolT m (MVar (ConnectionPoolT m) a)

newEmptyMVarN :: String -> ConnectionPoolT m (MVar (ConnectionPoolT m) a)

putMVar :: MVar (ConnectionPoolT m) a -> a -> ConnectionPoolT m ()

tryPutMVar :: MVar (ConnectionPoolT m) a -> a -> ConnectionPoolT m Bool

readMVar :: MVar (ConnectionPoolT m) a -> ConnectionPoolT m a

tryReadMVar :: MVar (ConnectionPoolT m) a -> ConnectionPoolT m (Maybe a)

takeMVar :: MVar (ConnectionPoolT m) a -> ConnectionPoolT m a

tryTakeMVar :: MVar (ConnectionPoolT m) a -> ConnectionPoolT m (Maybe a)

newIORef :: a -> ConnectionPoolT m (IORef (ConnectionPoolT m) a)

newIORefN :: String -> a -> ConnectionPoolT m (IORef (ConnectionPoolT m) a)

readIORef :: IORef (ConnectionPoolT m) a -> ConnectionPoolT m a

atomicModifyIORef :: IORef (ConnectionPoolT m) a -> (a -> (a, b)) -> ConnectionPoolT m b

writeIORef :: IORef (ConnectionPoolT m) a -> a -> ConnectionPoolT m ()

atomicWriteIORef :: IORef (ConnectionPoolT m) a -> a -> ConnectionPoolT m ()

readForCAS :: IORef (ConnectionPoolT m) a -> ConnectionPoolT m (Ticket (ConnectionPoolT m) a)

peekTicket' :: Proxy (ConnectionPoolT m) -> Ticket (ConnectionPoolT m) a -> a

casIORef :: IORef (ConnectionPoolT m) a -> Ticket (ConnectionPoolT m) a -> a -> ConnectionPoolT m (Bool, Ticket (ConnectionPoolT m) a)

modifyIORefCAS :: IORef (ConnectionPoolT m) a -> (a -> (a, b)) -> ConnectionPoolT m b

modifyIORefCAS_ :: IORef (ConnectionPoolT m) a -> (a -> a) -> ConnectionPoolT m ()

atomically :: STM (ConnectionPoolT m) a -> ConnectionPoolT m a

newTVarConc :: a -> ConnectionPoolT m (TVar (STM (ConnectionPoolT m)) a)

readTVarConc :: TVar (STM (ConnectionPoolT m)) a -> ConnectionPoolT m a

throwTo :: Exception e => ThreadId (ConnectionPoolT m) -> e -> ConnectionPoolT m ()

getMaskingState :: ConnectionPoolT m MaskingState

unsafeUnmask :: ConnectionPoolT m a -> ConnectionPoolT m a

(MonadMask m, MonadIO m) => RunQuery (QueryT m) (ConnectionPoolT m) Source #

Since: 0.0.0

Instance details

Defined in PostgreSQL.ConnectionPool

type IORef (ConnectionPoolT m) Source # 
Instance details

Defined in PostgreSQL.ConnectionPool

type IORef (ConnectionPoolT m) = IORef (PoolT Connection m)
type MVar (ConnectionPoolT m) Source # 
Instance details

Defined in PostgreSQL.ConnectionPool

type MVar (ConnectionPoolT m) = MVar (PoolT Connection m)
type STM (ConnectionPoolT m) Source # 
Instance details

Defined in PostgreSQL.ConnectionPool

type STM (ConnectionPoolT m) = STM (PoolT Connection m)
type ThreadId (ConnectionPoolT m) Source # 
Instance details

Defined in PostgreSQL.ConnectionPool

type ThreadId (ConnectionPoolT m) = ThreadId (PoolT Connection m)
type Ticket (ConnectionPoolT m) Source # 
Instance details

Defined in PostgreSQL.ConnectionPool

type Ticket (ConnectionPoolT m) = Ticket (PoolT Connection m)

runConnectionPoolT Source #

Arguments

:: (MonadIO m, MonadConc m) 
=> m Connection

Action to establish a new connection

-> Settings

Connection pool settings

-> ConnectionPoolT m a

Transformer to run

-> m a 

Run connection pool transformer.

Since: 0.0.0

defaultConnectionPoolSettings :: Settings Source #

Default settings for the connection pool

Since: 0.0.0

connectionPoolMetrics :: ConnectionPoolT m (Metrics Natural) Source #

Retrieve the connection pool metrics.

Since: 0.0.0