on dev help sign in
pool docs
9f2c323Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/PQ.hs−1
@@ -146,7 +146,6 @@ withConnection
146 :: forall schema0 schema1 io x
146 :: forall schema0 schema1 io x
147 . MonadBaseControl IO io
147 . MonadBaseControl IO io
148 => ByteString
148 => ByteString
149− -- -> (K LibPQ.Connection schema0 -> io (x, K LibPQ.Connection schema1))
150 -> PQ schema0 schema1 io x
149 -> PQ schema0 schema1 io x
151 -> io x
150 -> io x
152withConnection connString action = do
151withConnection connString action = do
squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+12
@@ -1,3 +1,13 @@
1+{-|
2+Module: Squeal.PostgreSQL.Definition
3+Description: Pooled connections
4+Copyright: (c) Eitan Chatav, 2017
5+Maintainer: eitan@morphism.tech
6+Stability: experimental
7+
8+A `MonadPQ` for pooled connections.
9+-}
10+
1{-# LANGUAGE
11{-# LANGUAGE
2 DataKinds
12 DataKinds
3 , DeriveFunctor
13 , DeriveFunctor
@@ -22,6 +32,8 @@ import Generics.SOP (K(..))
22import Squeal.PostgreSQL.PQ
32import Squeal.PostgreSQL.PQ
23import Squeal.PostgreSQL.Schema
33import Squeal.PostgreSQL.Schema
24
34
35+-- | `PoolPQ` @schema@ should be a drop-in replacement for
36+-- `PQ schema schema`.
25newtype PoolPQ (schema :: TablesType) m x =
37newtype PoolPQ (schema :: TablesType) m x =
26 PoolPQ { runPoolPQ :: Pool (K Connection schema) -> m x }
38 PoolPQ { runPoolPQ :: Pool (K Connection schema) -> m x }
27 deriving Functor
39 deriving Functor