-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A pool of connections for Hasql
--
-- A pool of connections for Hasql
@package hasql-pool
@version 0.6
module Hasql.Pool
-- | A pool of connections to DB.
data Pool
-- | Settings of the connection pool. Consist of:
--
--
-- - Pool-size.
-- - Timeout. An amount of time in milliseconds for which the unused
-- connections are kept open.
-- - Connection settings.
--
type Settings = (Int, Int, Settings)
-- | Given the pool-size, timeout and connection settings create a
-- connection-pool.
acquire :: Settings -> IO Pool
-- | Release the connection-pool.
release :: Pool -> IO ()
-- | A union over the connection establishment error and the session error.
data UsageError
-- | Error during an attempt to connect.
ConnectionUsageError :: ConnectionError -> UsageError
-- | Error during session execution.
SessionUsageError :: QueryError -> UsageError
-- | Pool has been released and can no longer be used.
PoolIsReleasedUsageError :: UsageError
-- | Use a connection from the pool to run a session and return the
-- connection to the pool, when finished. If the session fails with
-- ClientError the connection gets reestablished.
use :: Pool -> Session a -> IO (Either UsageError a)
instance GHC.Classes.Eq Hasql.Pool.UsageError
instance GHC.Show.Show Hasql.Pool.UsageError