Skip to content

ClientProjectionSpec

Defined in: packages/contracts/src/config.ts:561

optional journalTable?: string

Defined in: packages/contracts/src/config.ts:564


optional localIndexes?: readonly LocalIndexSpec[]

Defined in: packages/contracts/src/config.ts:582

OPT-IN local indexes for this entry’s synced table (ADR-0029 D3’s renderer, consumer-declared).

The local store renders a table’s PRIMARY KEY and nothing else — a synced table’s server-side indexes are NOT mirrored, deliberately: they serve server loads, and half of them cover columns a client projection omits. So a local read path that needs an index has to say so here, and only here.

Declare what the CLIENT’s queries need, not what the server has: a scan the app runs on every render over a large synced table (the motivating case: a due_at window over 100k rows — ~13 ms sequential vs ~0.1 ms indexed on pgwasm, logged by tests/unit/read-model-overlay-plan). Each index costs write time on every applied batch and space in the user’s store, so an index nothing queries is a straight loss.

Rendered on the synced table ONLY — never on the overlay, whose primary key is already its index and whose plan problem is not an index problem (see the read model’s non-membership test).


optional localPrimaryKey?: PrimaryKeySpec

Defined in: packages/contracts/src/config.ts:566


optional omitColumns?: readonly string[]

Defined in: packages/contracts/src/config.ts:565


optional overlayTable?: string

Defined in: packages/contracts/src/config.ts:563


optional syncedTable?: string

Defined in: packages/contracts/src/config.ts:562