Skip to content

Documentation / @etherfold/processor-entities / EntityRow

Type Alias: EntityRow<E> ​

EntityRow<E> = { readonly [K in IdColumnsOf<E>[number] | Extract<keyof E["fields"], string>]: K extends keyof E["fields"] ? FieldValue<E["fields"][K]> | null : string }

Defined in: packages/state-store/dist/declarations.d.ts:101

One row of a declared entity: its id columns, then its fields.

The id columns are string because a business key is stringified once, at the seam (idValues), so that {id: 1} and {id: '1'} are one entity on every backend. Every FIELD is nullable, and that is not defensiveness: set writes a WHOLE row, so a declared field the handler did not list IS null, and a type that hid it would be a type that lies on the common partial-write path.

The version columns (_lower, _upper) are deliberately absent: they are storage rather than state, and a read surface that handed them back would hand a caller something the declaration does not describe (and something that must never travel back into a write).

Type Parameters ​

E ​

E extends EntityDeclaration