Skip to main content

AttributeTarget

@webda/sql


Type Alias: AttributeTarget

AttributeTarget = { column: ColumnPlan; kind: "column"; } | { column: ColumnPlan; kind: "json"; path: string[]; } | { columns: ColumnPlan[]; kind: "reference"; relation: RelationPlan; } | { kind: "junction"; relation: RelationPlan; table: TablePlan; } | { kind: "mapped"; source: MappedSource; } | { column: ColumnPlan; kind: "extra"; path: string[]; } | { kind: "unknown"; }

Defined in: packages/sql/src/relational/mapping.ts:16

Where a model attribute lives in the table

  • column: a scalar field or a single-column reference
  • json: a JSON field, with the path inside it (may be empty)
  • reference: a reference to a composite key, one column per key part
  • junction: the rows of a junction table
  • mapped: a ModelsMapped filled on read from the table of its model, see MappedSource
  • extra: an unknown field kept in the extra JSON column
  • unknown: an unknown field and no extra column