module Hasql.Pool.Config.Setting where
import qualified Hasql.Connection as Connection
import Hasql.Pool.Config.Config (Config)
import qualified Hasql.Pool.Config.Config as Config
import Hasql.Pool.Observation (Observation)
import Hasql.Pool.Prelude
apply :: Setting -> Config -> Config
apply :: Setting -> Config -> Config
apply (Setting Config -> Config
run) = Config -> Config
run
newtype Setting
= Setting (Config -> Config)
size :: Int -> Setting
size :: Int -> Setting
size Int
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.size = x})
acquisitionTimeout :: DiffTime -> Setting
acquisitionTimeout :: DiffTime -> Setting
acquisitionTimeout DiffTime
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.acquisitionTimeout = x})
agingTimeout :: DiffTime -> Setting
agingTimeout :: DiffTime -> Setting
agingTimeout DiffTime
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.agingTimeout = x})
idlenessTimeout :: DiffTime -> Setting
idlenessTimeout :: DiffTime -> Setting
idlenessTimeout DiffTime
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.idlenessTimeout = x})
staticConnectionSettings :: Connection.Settings -> Setting
staticConnectionSettings :: Settings -> Setting
staticConnectionSettings Settings
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.connectionSettingsProvider = pure x})
dynamicConnectionSettings :: IO Connection.Settings -> Setting
dynamicConnectionSettings :: IO Settings -> Setting
dynamicConnectionSettings IO Settings
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.connectionSettingsProvider = x})
observationHandler :: (Observation -> IO ()) -> Setting
observationHandler :: (Observation -> IO ()) -> Setting
observationHandler Observation -> IO ()
x =
(Config -> Config) -> Setting
Setting (\Config
config -> Config
config {Config.observationHandler = x})