From bf728994ffedb9c994772fd3f63bc418cde57390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Choutri?= Date: Mon, 26 Jun 2023 22:11:01 +0200 Subject: [PATCH] Changelog for 0.0.4.3 --- CHANGELOG.md | 5 ++++- Makefile | 2 +- environment.sh | 2 ++ pg-entity.cabal | 2 +- .../Entity/Internal => test}/BlogPost.hs | 4 ++-- test/EntitySpec.hs | 20 +++++++++---------- test/GenericsSpec.hs | 2 +- test/Utils.hs | 2 +- 8 files changed, 22 insertions(+), 17 deletions(-) rename {src/Database/PostgreSQL/Entity/Internal => test}/BlogPost.hs (97%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3d94f0..4906a9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Revision history for Entity -## 0.0.4.0 -- YYYY-mm-dd +## 0.0.4.3 -- 2023-06-26 * Fix the URL of the tutorial +* Bump version bounds for `base`, `resource-pool` and `template-haskell` +* Bump supported minor GHC versions +* Internalise `Database.PostgreSQL.Entity.Internal.BlogPost` for the tests ## 0.0.3.0 -- 2022-10-30 diff --git a/Makefile b/Makefile index 3641ae0..7c803b9 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ lint: ## Run the code linter (HLint) @find test src -name "*.hs" | xargs -P $(PROCS) -I {} hlint --refactor-options="-i" --refactor {} style: ## Run the code styler (stylish-haskell) - @find docs/src test src -name "*.hs" | xargs -P $(PROCS) -I {} fourmolu -q --mode inplace {} @cabal-fmt -i *.cabal + @find docs/src test src -name "*.hs" | xargs -P $(PROCS) -I {} fourmolu -q --mode inplace {} docs-build: ## Generate the documentation @cd docs; mkdocs build diff --git a/environment.sh b/environment.sh index 6d9a45a..5d08240 100644 --- a/environment.sh +++ b/environment.sh @@ -6,3 +6,5 @@ export DB_PORT="5432" export DB_CONNSTRING="host=${DB_HOST} dbname=${DB_DATABASE} \ user=${DB_USER} password=${DB_PASSWORD} port=${DB_PORT}" + +export PGPASSWORD=${DB_PASSWORD} diff --git a/pg-entity.cabal b/pg-entity.cabal index ae78929..10b8fb7 100644 --- a/pg-entity.cabal +++ b/pg-entity.cabal @@ -98,7 +98,6 @@ library Database.PostgreSQL.Entity Database.PostgreSQL.Entity.DBT Database.PostgreSQL.Entity.Internal - Database.PostgreSQL.Entity.Internal.BlogPost Database.PostgreSQL.Entity.Internal.QQ Database.PostgreSQL.Entity.Internal.Unsafe Database.PostgreSQL.Entity.Types @@ -158,6 +157,7 @@ test-suite entity-test type: exitcode-stdio-1.0 main-is: Main.hs other-modules: + BlogPost EntitySpec GenericsSpec Utils diff --git a/src/Database/PostgreSQL/Entity/Internal/BlogPost.hs b/test/BlogPost.hs similarity index 97% rename from src/Database/PostgreSQL/Entity/Internal/BlogPost.hs rename to test/BlogPost.hs index 1d27df5..91d28c3 100644 --- a/src/Database/PostgreSQL/Entity/Internal/BlogPost.hs +++ b/test/BlogPost.hs @@ -3,7 +3,7 @@ {-# LANGUAGE StrictData #-} {-| - Module : Database.PostgreSQL.Entity.Internal.BlogPost + Module : BlogPost Copyright : © Clément Delafargue, 2018 Théophile Choutri, 2021 Koz Ross, 2021 @@ -16,7 +16,7 @@ The models described in this module are used throughout the library's tests and docspecs. -} -module Database.PostgreSQL.Entity.Internal.BlogPost where +module BlogPost where import Data.Text (Text) import Data.Time (UTCTime) diff --git a/test/EntitySpec.hs b/test/EntitySpec.hs index 3fc436a..8470aab 100644 --- a/test/EntitySpec.hs +++ b/test/EntitySpec.hs @@ -4,6 +4,16 @@ module EntitySpec where +import BlogPost + ( Author (..) + , AuthorId (..) + , BlogPost (..) + , bulkInsertAuthors + , bulkInsertBlogPosts + , insertAuthor + , insertBlogPost + , upsertBlogPost + ) import Control.Monad (void) import Control.Monad.IO.Class import Data.Text (Text) @@ -26,16 +36,6 @@ import Database.PostgreSQL.Entity , _where ) import Database.PostgreSQL.Entity.DBT (QueryNature (..), query) -import Database.PostgreSQL.Entity.Internal.BlogPost - ( Author (..) - , AuthorId (..) - , BlogPost (..) - , bulkInsertAuthors - , bulkInsertBlogPosts - , insertAuthor - , insertBlogPost - , upsertBlogPost - ) import Database.PostgreSQL.Simple (Only (Only)) import Database.PostgreSQL.Transact (DBT) diff --git a/test/GenericsSpec.hs b/test/GenericsSpec.hs index f24880f..9b48b67 100644 --- a/test/GenericsSpec.hs +++ b/test/GenericsSpec.hs @@ -3,6 +3,7 @@ module GenericsSpec where +import BlogPost import Data.Aeson import Data.Text import Data.Time @@ -10,7 +11,6 @@ import Data.UUID import Data.Vector import Database.PostgreSQL.Entity import Database.PostgreSQL.Entity.Internal (getTableName) -import Database.PostgreSQL.Entity.Internal.BlogPost import Database.PostgreSQL.Entity.Internal.Unsafe (Field (Field)) import Database.PostgreSQL.Entity.Types import Database.PostgreSQL.Simple diff --git a/test/Utils.hs b/test/Utils.hs index 9007f52..865c340 100644 --- a/test/Utils.hs +++ b/test/Utils.hs @@ -29,7 +29,7 @@ import Test.Tasty (TestTree) import qualified Test.Tasty as Test import qualified Test.Tasty.HUnit as Test -import Database.PostgreSQL.Entity.Internal.BlogPost +import BlogPost import qualified Database.PostgreSQL.Simple as PG import Database.PostgreSQL.Simple.Migration