-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d34ab0a
commit 77041bb
Showing
3 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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 = 3 | ||
|
||
-- | | ||
-- 10 seconds. | ||
acquisitionTimeout :: DiffTime | ||
acquisitionTimeout = 10 | ||
|
||
-- | | ||
-- 1 day. | ||
agingTimeout :: DiffTime | ||
agingTimeout = 60 * 60 * 24 | ||
|
||
-- | | ||
-- 10 minutes. | ||
idlenessTimeout :: DiffTime | ||
idlenessTimeout = 60 * 10 | ||
|
||
-- | | ||
-- > "postgresql://postgres:postgres@localhost:5432/postgres" | ||
staticConnectionSettings :: Connection.Settings | ||
staticConnectionSettings = "postgresql://postgres:postgres@localhost:5432/postgres" | ||
|
||
-- | | ||
-- > pure "postgresql://postgres:postgres@localhost:5432/postgres" | ||
dynamicConnectionSettings :: IO Connection.Settings | ||
dynamicConnectionSettings = pure "postgresql://postgres:postgres@localhost:5432/postgres" | ||
|
||
-- | | ||
-- > const (pure ()) | ||
observationHandler :: Observation -> IO () | ||
observationHandler = const (pure ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters