| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hasql.Pool
Documentation
type Settings = (Int, Int, Settings) Source #
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.
acquire :: Settings -> IO Pool Source #
Given the pool-size, timeout and connection settings create a connection-pool.
data UsageError Source #
A union over the connection establishment error and the session error.
Constructors
| ConnectionUsageError ConnectionError | Error during an attempt to connect. |
| SessionUsageError QueryError | Error during session execution. |
| PoolIsReleasedUsageError | Pool has been released and can no longer be used. |
Instances
| Show UsageError Source # | |
Defined in Hasql.Pool Methods showsPrec :: Int -> UsageError -> ShowS # show :: UsageError -> String # showList :: [UsageError] -> ShowS # | |
| Eq UsageError Source # | |
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. If the session fails
with ClientError the connection gets reestablished.