Skip to content

CanonicalReadContract

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

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 (physical 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 capability — mode, the overlay/journal projection, managedFields, conflictPolicy, writeMode (one client writes the table, another only reads it);
  • lifecycle orchestration — consistencyGroup, 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 customPredicate 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:270


localPrimaryKey: string[] | null

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


omitColumns: string[]

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


primaryKey: string[]

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


shape: { physicalTable: string | null; rowFilter: CanonicalRowFilter | null; scope: string[] | null; shapeKey: string; tableName: string; where: string | null; } | null

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

{ physicalTable: string | null; rowFilter: CanonicalRowFilter | null; scope: string[] | null; shapeKey: string; tableName: string; where: string | null; }

physicalTable: string | null

rowFilter: CanonicalRowFilter | null

scope: string[] | null

Shared-tier scope columns, in declaration order — the order parameterizes the family.

shapeKey: string

tableName: string

where: string | null

The native static predicate, canonicalized in full.

Unlike customPredicate, this one is visible: an AST can be hashed, where a closure could only ever be fingerprinted by its presence. So the revision footgun does not apply here — editing a native where shifts the fingerprint by itself, and a consumer cannot forget to say so.


null


syncedTable: string

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