Skip to content

CanonicalReadContract

Defined in: packages/contracts/src/fingerprint.ts:216

The read contract of a single sync table: the subset of its canonical shape that decides what data streams down and how a row is identified and filtered — synced-table name, columns, primary key (and any local-PK override), column omission, and the shape (electric table + row filter). It is the stable identity a writable entry shares with its asReadonly projection.

Deliberately EXCLUDES the two axes a per-client projection may legitimately differ on:

  • write capabilitymode, the overlay/journal projection, managedFields, conflictPolicy, writeMode (one client writes the table, another only reads it);
  • lifecycle orchestrationconsistencyGroup, subscription, retention (a client may eager- or lazy-load, or group differently, without changing the data it sees).

What it pins is the data itself: two registries that present “the same” logical table to different clients must agree here, or those clients are silently seeing different rows/columns. As with the full registry fingerprint, the customWhere body is invisible — only its presence and the consumer-bumped RowFilterSpec.revision participate, so bump revision to force a divergence a logic-only change would otherwise hide.

columns: CanonicalColumn[]

Defined in: packages/contracts/src/fingerprint.ts:220


localPrimaryKey: string[] | null

Defined in: packages/contracts/src/fingerprint.ts:219


omitColumns: string[]

Defined in: packages/contracts/src/fingerprint.ts:221


primaryKey: string[]

Defined in: packages/contracts/src/fingerprint.ts:218


shape: { electricTable: string | null; rowFilter: CanonicalRowFilter | null; shapeKey: string; tableName: string; } | null

Defined in: packages/contracts/src/fingerprint.ts:222


syncedTable: string

Defined in: packages/contracts/src/fingerprint.ts:217