persistent-postgresql 0.6.1.1 → 0.6.1.2
raw patch · 2 files changed
+14/−5 lines, 2 filesdep ~monad-control
Dependency ranges changed: monad-control
Files
Database/Persist/Postgresql.hs view
@@ -1,5 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleContexts #-} -- | A postgresql backend for persistent. module Database.Persist.Postgresql ( withPostgresqlPool@@ -25,7 +27,13 @@ import Control.Arrow import Data.List (sort, groupBy) import Data.Function (on)+#if MIN_VERSION_monad_control(0, 3, 0)+import Control.Monad.Trans.Control (MonadBaseControl)+#define MBCIO MonadBaseControl IO+#else import Control.Monad.IO.Control (MonadControlIO)+#define MBCIO MonadControlIO+#endif import Data.ByteString (ByteString) import qualified Data.Text as T@@ -37,13 +45,13 @@ import Control.Monad (forM) import Data.Neither (meither, MEither (..)) -withPostgresqlPool :: MonadControlIO m+withPostgresqlPool :: (MBCIO m, MonadIO m) => T.Text -> Int -- ^ number of connections to open -> (ConnectionPool -> m a) -> m a withPostgresqlPool s = withSqlPool $ open' s -withPostgresqlConn :: MonadControlIO m => T.Text -> (Connection -> m a) -> m a+withPostgresqlConn :: (MBCIO m, MonadIO m) => T.Text -> (Connection -> m a) -> m a withPostgresqlConn = withSqlConn . open' open' :: T.Text -> IO Connection@@ -89,7 +97,8 @@ _ <- H.execute stmt $ map pToSql vals return () -withStmt' :: MonadControlIO m+withStmt'+ :: (MBCIO m, MonadIO m) => H.Statement -> [PersistValue] -> (RowPopper m -> m a)
persistent-postgresql.cabal view
@@ -1,5 +1,5 @@ name: persistent-postgresql-version: 0.6.1.1+version: 0.6.1.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -21,7 +21,7 @@ , containers >= 0.2 && < 0.5 , bytestring >= 0.9 && < 0.10 , text >= 0.7 && < 0.12- , monad-control >= 0.2 && < 0.3+ , monad-control >= 0.2 && < 0.4 , time >= 1.1 , data-object >= 0.3 && < 0.4 , neither >= 0.3 && < 0.4