packages feed

kiroku-store 0.3.0.1 → 0.3.1.0

raw patch · 3 files changed

+43/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Kiroku.Store.Effect.Resource: runKirokuStoreWith :: forall (es :: [Effect]) a. IOE :> es => KirokuStore -> Eff (KirokuStoreResource ': es) a -> Eff es a

Files

CHANGELOG.md view
@@ -2,6 +2,26 @@  ## Unreleased +## 0.3.1.0 — 2026-07-22++### New Features++* `Kiroku.Store.Effect.Resource.runKirokuStoreWith` installs an already-acquired+  `KirokuStore` into the effect stack without acquiring or releasing it — the+  caller owns the handle's lifetime. Processes that open exactly one store, the+  arrangement `KirokuStoreResource` already documents, can now run several+  independent effectful actions against that one handle.++  Previously the only runner was `withKirokuStore`, which acquires. A caller+  that already held an open store but ran many actions through it paid for a+  connection pool, a dedicated `LISTEN` connection, and a publisher thread on+  every action. Switching one such caller to the new runner cut a+  command-line invocation from 5 PostgreSQL connections to 3.++  Note that `runKirokuStoreWith` requires `IOE` even though it neither brackets+  nor unlifts: `KirokuStoreResource` is a `Static WithSideEffects` effect, and+  `evalStaticRep` demands `IOE` for those.+ ## 0.3.0.1 — 2026-07-14  ### Bug Fixes
kiroku-store.cabal view
@@ -1,6 +1,6 @@ cabal-version:   3.0 name:            kiroku-store-version:         0.3.0.1+version:         0.3.1.0 synopsis:        High-performance PostgreSQL event store description:   Kiroku is a PostgreSQL-backed event store for Haskell applications. It
src/Kiroku/Store/Effect/Resource.hs view
@@ -9,6 +9,9 @@      -- * Bracket-style runner     withKirokuStore,++    -- * Runner over an existing handle+    runKirokuStoreWith, ) where  import Effectful (Dispatch (..), DispatchOf, Eff, Effect, IOE, UnliftStrategy (..), withEffToIO, (:>))@@ -52,3 +55,22 @@ withKirokuStore settings action = withEffToIO SeqUnlift $ \unlift ->     withStore settings $ \store ->         unlift (evalStaticRep (KirokuStoreResource store) action)++{- | Install an /already acquired/ 'KirokuStore' into the effect stack.++Unlike 'withKirokuStore', this neither acquires nor releases: the caller owns+the handle's lifetime. Use it when a process has opened exactly one store (the+documented arrangement) and needs to run several independent effectful actions+against it. Acquiring a store per action instead costs a connection pool, a+dedicated @LISTEN@ connection, and a publisher thread each time.++There is no bracket and no unlifting here, but @IOE@ is still required:+'KirokuStoreResource' is @Static WithSideEffects@, and 'evalStaticRep' demands+@IOE@ for any effect declared that way.+-}+runKirokuStoreWith ::+    (IOE :> es) =>+    KirokuStore ->+    Eff (KirokuStoreResource : es) a ->+    Eff es a+runKirokuStoreWith = evalStaticRep . KirokuStoreResource