git.iko.soy/typeable/postgresql-simple
on master help sign in
Remove transformer dependency (for now?)
2bb457aLeon P Smith
postgresql-simple.cabal+1−2
@@ -45,8 +45,7 @@ Library
45 pcre-light,
45 pcre-light,
46 old-locale,
46 old-locale,
47 text >= 0.11.0.2,
47 text >= 0.11.0.2,
48− time,
48+ time
49− transformers
50 -- Modules not exported by this package.
49 -- Modules not exported by this package.
51 -- Other-modules:
50 -- Other-modules:
52
51
src/Database/PostgreSQL/Simple/Implementation.hs+3−4
@@ -6,7 +6,6 @@ import Prelude hiding (catch)
6
6
7import Control.Applicative
7import Control.Applicative
8import Control.Exception
8import Control.Exception
9−import Control.Monad.IO.Class (MonadIO(liftIO))
10import Control.Concurrent.MVar
9import Control.Concurrent.MVar
11import Data.ByteString(ByteString)
10import Data.ByteString(ByteString)
12import qualified Data.IntMap as IntMap
11import qualified Data.IntMap as IntMap
@@ -100,11 +99,11 @@ defaultConnectInfo = ConnectInfo {
100
99
101-- | Connect with the given username to the given database. Will throw
100-- | Connect with the given username to the given database. Will throw
102-- an exception if it cannot connect.
101-- an exception if it cannot connect.
103−connect :: MonadIO m => ConnectInfo -> m Connection
102+connect :: ConnectInfo -> IO Connection
104connect = connectPostgreSQL . postgreSQLConnectionString
103connect = connectPostgreSQL . postgreSQLConnectionString
105
104
106−connectPostgreSQL :: MonadIO m => ByteString -> m Connection
105+connectPostgreSQL :: ByteString -> IO Connection
107−connectPostgreSQL connstr = liftIO $ do
106+connectPostgreSQL connstr = do
108 conn <- PQ.connectdb connstr
107 conn <- PQ.connectdb connstr
109 connectionHandle <- newMVar (Just conn)
108 connectionHandle <- newMVar (Just conn)
110 connectionObjects <- newMVar (IntMap.empty)
109 connectionObjects <- newMVar (IntMap.empty)