Event-storage E0 pre-work for the Weasel.Storage move#4885
Merged
Conversation
Two Marten-only refactors that shrink the movable closed-shape event-storage surface ahead of the Weasel.Storage extraction (event side of the W2 train): 1. Hoist QueryForStream off EventStorage<TId> into ClosedShapeEventDocumentStorage. The stream-state lookup rides Marten's query-handler pipeline (IQueryHandler<T> / StreamStateQueryHandler), which stays Marten-local, and the implementation was identical across all three append-mode storages. The movable hierarchy is now purely write-side, and the descriptors drop their StreamStateSelectSql slot (the adapter reads the base's StreamStateSelectSql instead). 2. Make the batched quick-append operation dialect-supplied via a CreateQuickAppendEventsOperation factory slot on the Quick / QuickWithServerTimestamps descriptors, installed by PostgresEventStoreDialect. The batch shape is inherently provider-specific (Postgres binds array parameters to mt_quick_append_events; SQL Server will use a different SQL shape entirely), so QuickAppendEventsOperation and QuickAppendEventsOperationBase stay Marten-local when the hierarchy moves. Validated: EventSourcingTests 1425 + TenantPartitionedEventsTests 215 green (net10), full solution Debug+Release clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the #4821 / #4830 follow-on: moving the closed-shape event storage (
src/Marten/EventStorage/) into Weasel.Storage so Polecat can shipSqlServerEventStoreDialect(the last gate on polecat#273). This is the Marten-only pre-work slice — no Weasel dependency, no behavior change.What
Hoist
QueryForStreamoffEventStorage<TId>intoClosedShapeEventDocumentStorage. The stream-state lookup rides Marten's query-handler pipeline (IQueryHandler<T>/StreamStateQueryHandler), which stays Marten-local — and the implementation was duplicated verbatim across all three append-mode storages. The movable hierarchy is now purely write-side, and the descriptors drop their now-deadStreamStateSelectSqlslot (the adapter uses the base'sStreamStateSelectSql).Batched quick-append becomes dialect-supplied via a
CreateQuickAppendEventsOperationfactory slot on the Quick / QuickWithServerTimestamps descriptors, installed byPostgresEventStoreDialect. The batch shape is inherently provider-specific (Postgres binds per-column array parameters tomt_quick_append_events; SQL Server will use a multi-row INSERT + OUTPUT shape), soQuickAppendEventsOperation/QuickAppendEventsOperationBasestay Marten-local when the hierarchy moves — exactly likePostgresStorageDialectstayed on the document side.Validation
Marten.slnxDebug + Release cleanNext slices (gated on Weasel): E1 neutral grouped-parameter builder in Weasel.Core, E2 descriptor-core move, E3 storage/ops move.
🤖 Generated with Claude Code