write<F extends Fields> method

List<Assignment> write<F extends Fields>(
  1. WriteValue<T, F> input,
  2. F fields
)

Produces no assignment for omission, and one for a supplied intent.

Expression callbacks and literal codecs run here, before SQL execution. Generated input builders call this once per surviving field intent.

Implementation

List<Assignment> write<F extends Fields>(WriteValue<T, F> input, F fields) =>
    switch (input) {
      _Keep<T, F>() => [],
      _Set<T, F>(:final value) => [set(value)],
      _Default<T, F>() => [defaultValue()],
      _Expression<T, F>(:final expression) => [
        setExpression(expression(fields)),
      ],
    };