Skip to content

Event-storage E1: de-Npgsql the closed-shape event binders + per-event ops (Weasel 9.14.0)#4898

Merged
jeremydmiller merged 1 commit into
masterfrom
feat/event-storage-e1-consume-weasel-9-14
Jul 7, 2026
Merged

Event-storage E1: de-Npgsql the closed-shape event binders + per-event ops (Weasel 9.14.0)#4898
jeremydmiller merged 1 commit into
masterfrom
feat/event-storage-e1-consume-weasel-9-14

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Part of the #4821 / #4830 follow-on — moving the closed-shape event storage into Weasel.Storage so Polecat can ship its SQL Server event dialect. This is the event-side analog of the document INC-3 increment: it consumes the new Weasel 9.14.0 neutral grouped-parameter seam to drop the direct Npgsql reference from the event metadata binders and the per-event append operations, in place (no file moves yet), leaving them ready for the E2/E3 physical move.

Follows E0 (#4885, merged).

Upstream (already published)

Weasel 9.14.0 (weasel#339) added a dialect-neutral grouped-parameter seam — Weasel.Core.IGroupedParameterBuilder, ICommandBuilder.CreateGroupedParameterBuilder(char?) / AppendParameter(object) — plus StorageColumnType.Binary.

Changes

  • IEventMetadataBinder.Bind now takes the neutral Weasel.Core.IGroupedParameterBuilder.
  • The 5 metadata binders (Sequence / Headers / Causation / Correlation / UserName) take a ctor-injected IStorageDialect and type their parameters via SetParameterType(param, StorageColumnType.X) instead of NpgsqlDbType — mirroring the document-side DocumentCausationIdBinder etc.
  • RichAppendEventOperation and QuickAppendEventWithVersionOperation bind their core columns the same way. The QuickWithVersion op gains an IStorageDialect ctor param; all three descriptors carry a Dialect slot the event dialect installs, resolved per stream identity from PostgresStorageDialect<TId>.
  • PostgresStorageDialect.SetParameterType maps the new StorageColumnType.BinaryNpgsqlDbType.Bytea (the event bdata column).
  • CompiledQueryPlan implements the two new neutral Weasel.Core.ICommandBuilder members explicitly, delegating to its existing Npgsql-typed implementations (same disambiguation weasel#327 needed).

PostgresEventStoreDialect and the Quick bulk operation (QuickAppendEventsOperation — array params to mt_quick_append_events, PostgresException MT001/MT003) stay Postgres-local by design.

Validation

  • EventSourcingTests: 1430 passed / 0 failed (net10)
  • TenantPartitionedEventsTests: 217 passed / 0 failed (net10)
  • LinqTests compiled-query filter: 75 passed / 0 failed (net10) — covers the CompiledQueryPlan change
  • Full Marten.slnx Debug + Release clean

Next: E2 moves the descriptor core + binders + IEventStoreSqlDialect into Weasel.Storage; E3 moves the storage hierarchy + ops.

🤖 Generated with Claude Code

…t ops (consume Weasel 9.14.0)

Consumes Weasel 9.14.0 (weasel#339: dialect-neutral grouped-parameter seam +
StorageColumnType.Binary) to drop the direct Npgsql reference from the
closed-shape event metadata binders and the two per-event append operations,
in place — no file moves. This is the event-side analog of the document INC-3
increment and prepares these types for the E2/E3 physical move into
Weasel.Storage.

- IEventMetadataBinder.Bind now takes the neutral Weasel.Core.IGroupedParameterBuilder.
- The 5 metadata binders (Sequence/Headers/Causation/Correlation/UserName)
  take a ctor-injected IStorageDialect and set provider parameter types via
  SetParameterType(param, StorageColumnType.X) instead of NpgsqlDbType.
- RichAppendEventOperation + QuickAppendEventWithVersionOperation bind their
  core columns the same way; the QuickWithVersion op gains an IStorageDialect
  ctor param, and all three descriptors carry a Dialect slot the event dialect
  installs (resolved per stream identity from PostgresStorageDialect<TId>).
- PostgresStorageDialect.SetParameterType maps the new StorageColumnType.Binary
  to NpgsqlDbType.Bytea (event bdata column).
- CompiledQueryPlan implements the two new neutral Weasel.Core.ICommandBuilder
  members (AppendParameter(object) / CreateGroupedParameterBuilder) explicitly,
  delegating to its existing Npgsql-typed implementations.

PostgresEventStoreDialect and the Quick bulk operation (QuickAppendEventsOperation,
array params to mt_quick_append_events) stay Postgres-local by design.

Validated (net10): EventSourcingTests 1430, TenantPartitionedEventsTests 217,
LinqTests compiled-query 75, all green; full solution Debug + Release clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant