extended-0.1.0: Extended versions of common modules
Safe HaskellNone
LanguageGHC2021

Hasql.Pool.Extended

Synopsis

Documentation

data PoolConfig Source #

Constructors

PoolConfig 

Fields

  • size :: Int
     
  • acquisitionTimeout :: Duration

    Configured pool acquisition wait time. hasql-resource-pool only accepts whole seconds here, so we round up to the nearest second and pass it through as the pool acquisition timeout.

  • idlenessTimeout :: Duration

    Controls how long idle connections stay resident in the pool.

data Pool Source #

Constructors

Pool 

Fields

runConnStrParser :: Parsec Void Text a -> IO a Source #

Run a postgresql-connection-string parser, turning a parse failure into an IO exception whose message is the parser's failure text, so the reason is visible wherever this call site's crash output is captured.

errorBundlePretty is avoided because fromKeyValueParams never consumes the (always-empty) input stream, so its source-position pointer would be meaningless noise around the actual message.

initPostgresPool :: PoolConfig -> Map Text Text -> Maybe FilePathSecrets -> IO Pool Source #

Creates a pool from postgres config params.

acquisitionTimeout is mapped to the pool acquisition timeout, idlenessTimeout controls how long idle connections stay resident.