module Hasql.Pool.Config.Defaults where

import qualified Hasql.Connection as Connection
import Hasql.Pool.Observation (Observation)
import Hasql.Pool.Prelude

-- |
-- 3 connections.
size :: Int
size :: Int
size = Int
3

-- |
-- 10 seconds.
acquisitionTimeout :: DiffTime
acquisitionTimeout :: DiffTime
acquisitionTimeout = DiffTime
10

-- |
-- 1 day.
agingTimeout :: DiffTime
agingTimeout :: DiffTime
agingTimeout = DiffTime
60 DiffTime -> DiffTime -> DiffTime
forall a. Num a => a -> a -> a
* DiffTime
60 DiffTime -> DiffTime -> DiffTime
forall a. Num a => a -> a -> a
* DiffTime
24

-- |
-- 10 minutes.
idlenessTimeout :: DiffTime
idlenessTimeout :: DiffTime
idlenessTimeout = DiffTime
60 DiffTime -> DiffTime -> DiffTime
forall a. Num a => a -> a -> a
* DiffTime
10

-- |
-- > "postgresql://postgres:postgres@localhost:5432/postgres"
staticConnectionSettings :: Connection.Settings
staticConnectionSettings :: Settings
staticConnectionSettings = Settings
"postgresql://postgres:postgres@localhost:5432/postgres"

-- |
-- > pure "postgresql://postgres:postgres@localhost:5432/postgres"
dynamicConnectionSettings :: IO Connection.Settings
dynamicConnectionSettings :: IO Settings
dynamicConnectionSettings = Settings -> IO Settings
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Settings
"postgresql://postgres:postgres@localhost:5432/postgres"

-- |
-- > const (pure ())
observationHandler :: Observation -> IO ()
observationHandler :: Observation -> IO ()
observationHandler = IO () -> Observation -> IO ()
forall a b. a -> b -> a
const (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())