consumers 2.2.0.2 → 2.2.0.3
raw patch · 5 files changed
+35/−21 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- README.md +4/−1
- consumers.cabal +5/−4
- example/Example.hs +11/−9
- test/Test.hs +12/−7
CHANGELOG.md view
@@ -1,3 +1,6 @@+# consumers-2.2.0.3 (2021-05-28)+* Support GHC 9.0.+ # consumers-2.2.0.2 (2020-05-05) * Support hpqtypes-1.9.0.0 and relax base.
README.md view
@@ -1,4 +1,7 @@-# consumers [](https://hackage.haskell.org/package/consumers) [](http://travis-ci.org/scrive/consumers)+# consumers++[](https://hackage.haskell.org/package/consumers)+[](https://github.com/scrive/consumers/actions?query=branch%3Amaster) Library for setting up concurrent consumers of data stored inside PostgreSQL database in a simple, declarative manner.
consumers.cabal view
@@ -1,5 +1,5 @@ name: consumers-version: 2.2.0.2+version: 2.2.0.3 synopsis: Concurrent PostgreSQL data consumers description: Library for setting up concurrent consumers of data@@ -18,7 +18,8 @@ category: Concurrency, Database build-type: Simple cabal-version: >=1.10-tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.3 || ==8.10.1+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4+ || ==9.0.1 Source-repository head Type: git@@ -34,11 +35,11 @@ build-depends: base >= 4.9 && < 5 , containers >= 0.5 && < 0.7 , exceptions >= 0.10 && < 0.11- , extra >= 1.6 && < 1.7+ , extra >= 1.6 && < 1.8 , hpqtypes >= 1.7 && < 2.0 , lifted-base >= 0.2 && < 0.3 , lifted-threads >= 1.0 && < 1.1- , log-base >= 0.7 && < 0.9+ , log-base >= 0.7 && < 0.10 , monad-control >= 1.0 && < 1.1 , monad-time >= 0.3 && < 0.4 , mtl >= 2.2 && < 2.3
example/Example.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -21,6 +22,7 @@ import Log.Backend.StandardOutput import Prelude import System.Environment+import System.Exit import TextShow import qualified Data.Text as T@@ -31,13 +33,14 @@ main :: IO () main = do- args <- getArgs- let connString = case args of- [] -> defaultConnString- (cs:_) -> cs+ connString <- getArgs >>= \case+ connString : _args -> return $ T.pack connString+ [] -> lookupEnv "GITHUB_ACTIONS" >>= \case+ Just "true" -> return "host=postgres user=postgres password=postgres"+ _ -> printUsage >> exitFailure let connSettings = defaultConnectionSettings- { csConnInfo = T.pack connString }+ { csConnInfo = connString } ConnectionSource connSource = simpleSource connSettings -- Monad stack initialisation.@@ -61,10 +64,9 @@ dropTables where-- -- How to connect to DB.- defaultConnString =- "postgresql://postgres@localhost/travis_ci_test"+ printUsage = do+ prog <- getProgName+ putStrLn $ "Usage: " <> prog <> " <connection info string>" tables = [consumersTable, jobsTable] -- NB: order of migrations is important.
test/Test.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -32,6 +33,7 @@ import Log.Backend.StandardOutput import Prelude import System.Environment+import System.Exit import TextShow import qualified Data.Text as T@@ -72,13 +74,14 @@ test :: IO () test = do- args <- getArgs- let connString = case args of- [] -> defaultConnString- (cs:_) -> cs+ connString <- getArgs >>= \case+ connString : _args -> return $ T.pack connString+ [] -> lookupEnv "GITHUB_ACTIONS" >>= \case+ Just "true" -> return "host=postgres user=postgres password=postgres"+ _ -> printUsage >> exitFailure let connSettings = defaultConnectionSettings- { csConnInfo = T.pack connString }+ { csConnInfo = connString } ConnectionSource connSource = simpleSource connSettings withSimpleStdOutLogger $ \logger ->@@ -111,8 +114,10 @@ dropTables where waitUntilTrue tmvar = whileM_ (not <$> (liftIO $ atomically $ takeTMVar tmvar)) $ return ()- defaultConnString =- "postgresql://postgres@localhost/travis_ci_test"++ printUsage = do+ prog <- getProgName+ putStrLn $ "Usage: " <> prog <> " <connection info string>" tables = [consumersTable, jobsTable] -- NB: order of migrations is important.