Skip to content

Override IEventStore.AllDatabases() on DocumentStore; consume JasperFx 2.2.0 (#4570)#4571

Merged
jeremydmiller merged 1 commit into
masterfrom
feature/4570-all-databases
May 27, 2026
Merged

Override IEventStore.AllDatabases() on DocumentStore; consume JasperFx 2.2.0 (#4570)#4571
jeremydmiller merged 1 commit into
masterfrom
feature/4570-all-databases

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Closes #4570.

What

  • Override IEventStore.AllDatabases() on DocumentStore. Implements the store-agnostic database accessor added to JasperFx.Events.IEventStore in jasperfx#387 / jasperfx#388. A straight delegation to ITenancy (Tenancy.BuildDatabases()), mirroring the existing IMartenStorage.AllDatabases(), projecting to IEventDatabase via OfType<> since IMartenDatabase does not itself extend IEventDatabase (only the concrete MartenDatabase does).
  • Consume JasperFx 2.2.0 across all JasperFx.* packages (JasperFx, JasperFx.Events, JasperFx.Events.SourceGenerator, JasperFx.SourceGenerator).
  • Bump Marten version to 9.2.0.

Why

Store-agnostic monitoring/tooling (e.g. CritterWatch) needs an IEventDatabase to call the read abstractions — AllProjectionProgress(...), FetchDeadLetterCountsAsync(...) / CountDeadLetterEventsAsync(...). But a Marten + Wolverine host registers IEventStore (the concrete DocumentStore) in DI and does not register IEventDatabase, so GetServices<IEventDatabase>() is empty. IEventStore.AllDatabases() is the store-neutral way to reach the databases.

Test

Added event_store_all_databases_returns_one_event_database_per_database to the multi-database (MultiTenantedDatabases) fixture in DocumentStore_IMartenStorage_implementation: asserts AllDatabases() returns one IEventDatabase per configured database and that each can serve AllProjectionProgress() / FetchDeadLetterCountsAsync(). Passes locally (10/10 in the fixture).

🤖 Generated with Claude Code

…x 2.2.0 (#4570)

Implements the store-agnostic database accessor added to
JasperFx.Events.IEventStore in #387/#388. Marten + Wolverine
hosts register IEventStore (the concrete DocumentStore) in DI but not
IEventDatabase, so store-neutral tooling (e.g. CritterWatch) had no way
to reach the per-database read abstractions. AllDatabases() delegates
straight to ITenancy, mirroring IMartenStorage.AllDatabases(), and
projects to IEventDatabase (IMartenDatabase does not itself extend it).

Also bumps all JasperFx.* packages to 2.2.0 and the Marten version to
9.2.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit d4a6800 into master May 27, 2026
6 checks passed
@jeremydmiller jeremydmiller deleted the feature/4570-all-databases branch May 27, 2026 22:45
This was referenced May 28, 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.

Override IEventStore.AllDatabases() on DocumentStore (jasperfx#387)

1 participant