Documentation / @super-line/core / LwwCollectionDef
Interface: LwwCollectionDef
Defined in: packages/core/src/contract.ts:93
A typed row collection (the relational store family; see ADR-0006). Rows are validated against schema on every write — end-to-end types + validate-every-message for row data.
Properties
indexes?
optionalindexes?: readonly readonlystring[][]
Defined in: packages/core/src/contract.ts:109
Backend-created query indexes. Each inner array is one ordered composite index.
key
key:
string
Defined in: packages/core/src/contract.ts:101
The primary-key field: row[key] becomes the resource id, so it must be a present string field. Kept as a plain string (not keyof row) to avoid perturbing defineContract's inference — the server validates its presence/type at write time. // ponytail: tighten to keyof InferOut<schema> later if the inference cost is worth it.
references?
optionalreferences?:Record<string,string>
Defined in: packages/core/src/contract.ts:107
Advisory foreign keys — { authorId: 'users' } maps a field to a referenced collection name. Metadata only: feeds the Control Center schema graph and TanStack adapter join hints, plus an opt-in existence check on write. No cascades in core (unsound under masterless relay clustering).
schema
schema:
Schema
Defined in: packages/core/src/contract.ts:95
Row schema — any Standard Schema (Zod/Valibot/ArkType). The server validates every row write against it.