hasql-pool-0.5.2: A pool of connections for Hasql

Safe HaskellNone
LanguageHaskell2010

Hasql.Pool

Synopsis

Documentation

data Pool Source #

A pool of connections to DB.

Instances
Show Pool Source # 
Instance details

Defined in Hasql.Pool

Methods

showsPrec :: Int -> Pool -> ShowS #

show :: Pool -> String #

showList :: [Pool] -> ShowS #

type Settings = (Int, NominalDiffTime, Settings) Source #

Settings of the connection pool. Consist of:

  • Pool-size.
  • Timeout. An amount of time for which an unused resource is kept open. The smallest acceptable value is 0.5 seconds.
  • Connection settings.

acquire :: Settings -> IO Pool Source #

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

release :: Pool -> IO () Source #

Release the connection-pool.

data UsageError Source #

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

Instances
Eq UsageError Source # 
Instance details

Defined in Hasql.Pool

Show UsageError Source # 
Instance details

Defined in Hasql.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.