Skip to main content

Module write_payload

Module write_payload 

Source
Expand description

Runtime payload shapes for typed write inputs.

Phase 5a wires the codegen-emitted <Model>CreateInput and <Model>UpdateInput structs into the existing CreateOperation / UpdateOperation / UpdateManyOperation / UpsertOperation builders. The translation is purely additive: each input lowers to a list of column-keyed assignments that the builder appends to its existing internal state.

  • CreateInput::Data is fixed to CreatePayload — the same Vec<(column, value)> shape that the existing CreateOperation::set_many already accepts.
  • UpdateInput::Data is fixed to UpdatePayload — a list of (column, WriteOp) pairs that carry the atomic-operator information IntFieldUpdate { increment, decrement, multiply, divide, set }, StringNullableFieldUpdate { unset }, etc. express.

Nested writes (relation operators inside data:) are deferred to phase 5b and have no payload here — phase 5a’s codegen rejects relation keys with a clear “phase 5b” diagnostic before any lowering reaches the runtime.

Enums§

WriteOp
One scalar update operator applied to a column.

Type Aliases§

CreatePayload
Flat column-value payload for a single-row create.
UpdatePayload
Flat column-operator payload for an update.