keiro-test-support 0.23.0.0 → 0.24.0.0
raw patch · 3 files changed
+21/−2 lines, 3 filesdep ~keiro-migrationsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: keiro-migrations
API changes (from Hackage documentation)
+ Keiro.Test.Postgres: withFreshResourceStoreWithConnection :: Fixture -> (ConnectionSettings -> ConnectionSettings) -> (Text -> (KirokuStore, StoreRunner) -> IO a) -> IO a
Files
- CHANGELOG.md +7/−0
- keiro-test-support.cabal +2/−2
- src/Keiro/Test/Postgres.hs +12/−0
CHANGELOG.md view
@@ -6,6 +6,13 @@ ## [Unreleased] +## 0.24.0.0 — 2026-11-05++### New Features++- Add `withFreshResourceStoreWithConnection`, supplying a fresh database+ connection string and resource-aware store runner with configurable settings.+ ## 0.23.0.0 — 2026-10-30 ### Breaking Changes
keiro-test-support.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: keiro-test-support-version: 0.23.0.0+version: 0.24.0.0 synopsis: Shared PostgreSQL test fixtures for Keiro test suites description: Suite-level ephemeral-PostgreSQL fixtures shared by the Keiro test@@ -58,7 +58,7 @@ ephemeral-pg >=0.3.1 && <0.4, hasql >=1.10 && <1.11, hasql-pool >=1.2 && <1.5,- keiro-migrations ^>=0.23.0.0,+ keiro-migrations ^>=0.24.0.0, kiroku-store ^>=0.13.0.1, kiroku-store-migrations ^>=0.7.3.0, pg-migrate ^>=1.2.0.0,
src/Keiro/Test/Postgres.hs view
@@ -33,6 +33,7 @@ StoreRunner (..), withFreshResourceStore, withFreshResourceStoreWith,+ withFreshResourceStoreWithConnection, withFreshResourceStorePrepared, withFreshStores2, withFreshResourceStoresSameDatabase,@@ -220,6 +221,17 @@ withFreshResourceStoreWith fixture modify action = withFreshDatabase fixture \connStr -> runResourceStore (modify (Store.defaultConnectionSettings connStr)) action++-- | Like 'withFreshResourceStoreWith', also supplying the clone's connection+-- string so another bracketed host can connect to the same isolated database.+withFreshResourceStoreWithConnection ::+ Fixture ->+ (Store.ConnectionSettings -> Store.ConnectionSettings) ->+ (Text -> (Store.KirokuStore, StoreRunner) -> IO a) ->+ IO a+withFreshResourceStoreWithConnection fixture modify action =+ withFreshDatabase fixture \connStr ->+ runResourceStore (modify (Store.defaultConnectionSettings connStr)) (action connStr) -- | Clone a database, let a privileged store prepare database roles or ACLs, -- then open the resource-aware store with modified application settings.