Skip to content

Compliance suite: flat-table event projections — needs a table-inspection capability on the fixture #5147

Description

@jeremydmiller

Part of #5118 (compliance wave growth), epic #5110.

Unparks the one candidate explicitly deferred in wave 2. Flat-table event projections (an EventProjection writing into a plain relational table rather than a document) are tested in both repos and were held back because asserting the result means reading a table, and the compliance fixture has no table-inspection capability — the products' schema prefixes differ (mt_ vs pc_), as do their DDL and their SQL dialects.

What each store tests today

Marten Polecat
Projections/Flattened/* Projections/flat_table_projection_tests.cs
Projections/EventProjections/* (flat-table cases) Projections/using_event_projection_for_flat_tables.cs

The design question this issue has to settle

The suite needs to assert "row exists in table T with columns X=…, Y=…" without speaking either dialect. Options:

A. A narrow query capability on the fixture. One member, something like:

public abstract Task<IReadOnlyList<IDictionary<string, object?>>> QueryTableAsync(
    string tableName, CancellationToken token);

The fixture resolves the schema/prefix and runs the dialect-appropriate select *. Smallest surface; the suite never sees SQL. Downside: it is the first fixture member that is a raw data-access escape hatch, and it invites reuse for things that should stay product-specific.

B. Assert through the projection's own read path. Only viable if both products expose a supported way to read a flat-table projection's rows, which today they do not.

C. Assert on schema objects rather than data — that the table and columns were created with the right shape, via each product's schema-diagnostics API. Weaker, but it covers the part that actually drifts (the DDL the projection generates) and needs no data access.

Recommendation is A, deliberately narrow (table name in, rows out, no predicates, no SQL from the suite), with the fixture owning prefix resolution — but this is the decision the issue exists to make, so record the rationale wherever it lands.

Scope once the capability lands

  1. Flat-table projection creates its table with the declared columns and types
  2. Insert / update / delete per event type
  3. Column mapping from event body members, including a computed column
  4. Async and inline lifecycles produce the same rows
  5. Rebuild truncates and repopulates

Acceptance

  • Capability decision recorded in the issue and in the fixture's XML docs
  • Suite enrolled in both stores
  • Originals retired in both repos

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