Skip to content

[jasperfx] Shared batch-DCB query interface + Marten/Polecat implementations (P3.2b) #5115

Description

@jeremydmiller

Part of #5110. Target repo: JasperFx/jasperfx for the interface, then small follow-up PRs in Marten and Polecat to implement it (tracked here).

The batched-query DCB surface is the one seed-suite seam with no JasperFx abstraction at all, and the two products expose the same operations at different paths:

  • Marten: batch.Events.EventsExist(query) / batch.Events.FetchForWritingByTags<T>(query) via IBatchEvents Events { get; } on IBatchedQuery (src/Marten/Services/BatchQuerying/IBatchedQuery.cs)
  • Polecat: batch.EventsExist(query) / batch.FetchForWritingByTags<T>(query) flat on its IBatchedQuery (src/Polecat/Batching/IBatchedQuery.cs)

Method names/signatures already match exactly — only the accessor path differs.

Proposal: add to JasperFx.Events something like

public interface IBatchedEventQueries
{
    Task<bool> EventsExist(EventTagQuery query);
    Task<IEventBoundary<T>> FetchForWritingByTags<T>(EventTagQuery query) where T : class;
}

with Marten's IBatchEvents and Polecat's IBatchedQuery (or its batch-events sub-object, added for source compatibility) implementing it. The compliance seam's IComplianceBatch then becomes a thin adapter — or disappears once both stores expose the shared interface from CreateBatchQuery().

Exact shape should be finalized against the DCB suite's real usage in P3.1b before the jasperfx PR goes up (the suite work will prove whether Execute(ct) belongs on the shared interface or stays store-side). Polecat-side implementation is a hand-off item.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions