Skip to content

GH-3109: enable Polecat ancillary stores + generic [Storage] attribute#3112

Merged
jeremydmiller merged 1 commit into
mainfrom
feature-3109-ancillary-storage-attributes
Jun 15, 2026
Merged

GH-3109: enable Polecat ancillary stores + generic [Storage] attribute#3112
jeremydmiller merged 1 commit into
mainfrom
feature-3109-ancillary-storage-attributes

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #3109.

Enables the dormant Polecat ancillary-store integration (dead code behind an undefined #if POLECAT_1_1) and adds a provider-agnostic [Storage(Type)] attribute so a single attribute can route a handler to a Marten or Polecat ancillary store (EF Core later).

Core (Wolverine.Persistence)

Marten

  • MartenAncillaryStoreFrameProvider + chain.UseMartenStore(type). [MartenStore] now routes through the shared extension (behavior unchanged; all existing ancillary tests still pass).

Polecat

  • Removed the #if POLECAT_1_1 guards from the four ancillary files.
  • [PolecatStore], PolecatStoreEagerPolicy, PolecatAncillaryStoreFrameProvider, chain.UsePolecatStore(type).
  • The ancillary PolecatOverrides<T> now wires PolecatToWolverineOutbox so inline-projection side effects on an ancillary store relay through the Wolverine outbox (it was a no-op, so they were silently dropped).

Frame providers are registered in the primary IntegrateWithWolverine extension method (not *Integration.Configure) so the singleton is visible to the codegen-time IServiceContainer that StorageAttribute.Modify queries.

Dependency

Requires Polecat 4.5.0 (JasperFx/polecat#194). AddPolecatStore<T> hard-cast a bare DocumentStore to the marker interface in every prior version, so it threw InvalidCastException on resolution — the whole ancillary path could never have worked at runtime. Directory.Packages.props is bumped to 4.5.0.

Tests & docs

  • Full Polecat ancillary battery: bootstrap + end-to-end [PolecatStore] middleware, separate SQL Server databases + multi-tenant (MultiTenantedMessageStore), identity-URI uniqueness, inline-projection side effects relayed through the outbox, and [Storage] routing — 10 tests.
  • Marten [Storage] mirror.
  • New Polecat ancillary-stores doc + [Storage] sections on the Marten doc + sidebar.
  • Full wolverine.slnx Release build is clean (0/0) against published Polecat 4.5.0.

🤖 Generated with Claude Code

Enable the dormant Polecat ancillary-store integration (was dead code behind an
undefined #if POLECAT_1_1) and add a provider-agnostic [Storage(Type)] attribute.

Core (Wolverine.Persistence):
- IAncillaryStoreFrameProvider: a seam each persistence integration registers so
  the generic [Storage(typeof(IStore))] attribute can route a handler to the
  store's outbox-enrolled session purely from the marker type (Marten, Polecat,
  EF Core later).
- StorageAttribute + chain.UseAncillaryStorage(type, container) extension.
- StorageAttributeEagerPolicy: Phase-A pre-population of chain.AncillaryStoreType
  (mirrors the per-provider eager policies; GH-2944 ordering).

Marten:
- MartenAncillaryStoreFrameProvider + chain.UseMartenStore(type); MartenStore
  attribute now routes through the shared extension (behavior unchanged).

Polecat:
- Removed the #if POLECAT_1_1 guards from the four ancillary files.
- [PolecatStore] attribute, PolecatStoreEagerPolicy, PolecatAncillaryStoreFrame-
  Provider, chain.UsePolecatStore(type).
- Ancillary PolecatOverrides<T> now wires PolecatToWolverineOutbox so inline-
  projection side effects on an ancillary store relay through the Wolverine outbox.

Frame providers are registered in the primary IntegrateWithWolverine extension
method (not *Integration.Configure) so the singleton is visible to the codegen-
time IServiceContainer that StorageAttribute.Modify queries.

Tests: full Polecat ancillary battery (bootstrap, separate SQL Server databases +
multi-tenant, identity-URI uniqueness, inline-projection side effects, [Storage])
plus the Marten [Storage] mirror. Docs for both.

Requires Polecat 4.5.0 (JasperFx/polecat#194) — AddPolecatStore<T> could not
produce a typed store before that fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit c790a5d into main Jun 15, 2026
24 checks passed
This was referenced Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Polecat ancillary-store + Wolverine integration (dead-code behind #if POLECAT_1_1) and add [PolecatStore] to mirror Marten

1 participant