hasql-pool-0.7.1.1: A pool of connections for Hasql
Safe HaskellNone
LanguageHaskell2010

Hasql.Pool

Contents

Synopsis

--

data Pool Source #

A pool of connections to DB.

acquire :: Int -> Settings -> IO Pool Source #

Given the pool-size and connection settings create a connection-pool.

release :: Pool -> IO () Source #

Release all the connections in the pool.

use :: Pool -> Session a -> IO (Either UsageError a) Source #

Use a connection from the pool to run a session and return the connection to the pool, when finished.

Session failing with a ClientError get interpreted as a loss of connection. In such case the connection does not get returned to the pool and a slot gets freed up for a new connection to be established the next time one is needed. The error still gets returned from this function.

--

data UsageError Source #

A union over the connection establishment error and the session error.

Instances

Instances details
Eq UsageError Source # 
Instance details

Defined in Hasql.Pool

Show UsageError Source # 
Instance details

Defined in Hasql.Pool

Exception UsageError Source # 
Instance details

Defined in Hasql.Pool