@@ -8,7 +8,7 @@ Stability: experimental
88Connection pools.
99
1010Typical use case would be to create your pool using `createConnectionPool`
11−and run anything that requires the pool connection with `useConnectionPool`.
11+and run anything that requires the pool connection with `usingConnectionPool`.
1212
1313Here's a simplified example:
1414
@@ -20,7 +20,7 @@ do
2020 query :: Query_ (Public '[]) () (Only Char)
2121 query = values_ (literal 'a' `as` #fromOnly)
2222 pool <- createConnectionPool "host=localhost port=5432 dbname=exampledb" 1 0.5 10
23− chr <- useConnectionPool pool $ do
23+ chr <- usingConnectionPool pool $ do
2424 result <- runQuery query
2525 Just (Only a) <- firstRow result
2626 return a
@@ -47,7 +47,7 @@ module Squeal.PostgreSQL.Pool
4747 ( -- * Pools
4848 Pool
4949 , createConnectionPool
50− , useConnectionPool
50+ , usingConnectionPool
5151 , destroyConnectionPool
5252 ) where
5353
@@ -82,12 +82,12 @@ createConnectionPool
8282createConnectionPool conninfo stripes idle maxResrc =
8383 createPool (connectdb conninfo) finish stripes idle maxResrc
8484
85−useConnectionPool
85+usingConnectionPool
8686 :: MonadUnliftIO io
8787 => Pool (K Connection schemas) -- ^ pool
8888 -> PQ schemas schemas io x -- ^ session
8989 -> io x
90−useConnectionPool pool (PQ session) = unK <$> withResource pool session
90+usingConnectionPool pool (PQ session) = unK <$> withResource pool session
9191
9292{- |
9393Destroy all connections in all stripes in the pool.
@@ -97,7 +97,7 @@ This function is useful when you detect that all connections
9797in the pool are broken. For example after a database has been
9898restarted all connections opened before the restart will be broken.
9999In that case it's better to close those connections so that
100−`useConnectionPool` won't take a broken connection from the pool
100+`usingConnectionPool` won't take a broken connection from the pool
101101but will open a new connection instead.
102102
103103Another use-case for this function is that when you know you are done