Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 30 Oct 2026. What's built · Install 0.1.0
jadpo
Reference: Reads and writes

Reads and writes · rule

data.update_by_id_value

Update by id sets a value from something it can't use.

Area 6, Reads and writes; not declinable; the next step is usually the agent's.

An update by id is worked out by the database in one step, so its values use only parameters, constants, clock.now and the record's stored fields, and a stored field only with + and -:

example
type Count = Int {    min: 0}entity Counter {    id: Uuid    hits: Count}action hit(counter_id: Counter.id) fails CounterNotFound -> Counter {    var counter: Counter = attempt Counter.get(counter_id)    return attempt Counter.update(counter_id) {        set: {            hits: Count(counter.hits + 1)        }    }}
text
error: `Counter.update` by `id` sets a value from `counter`, a variable --> main.jadpo:14:25   |14 |             hits: Count(counter.hits + 1)   |                         ^^^^^^^ a variable  reason: An update by `id` is worked out by the database in one step, so its values use only the action's parameters, constants, `clock.now` and `Counter`'s stored fields; a value read earlier could have changed by the time it writes.  next: Load the record and update it, `Counter.update(counter) { set: { ... } }`, or pass the value in as a parameter (agent)  rule: data.update_by_id_value  help: https://jadpo.dev/docs/errors/data.update_by_id_valuecheck failed: 1 error, 1 file

Markdown for agents: /docs/errors/data.update_by_id_value.md.Built from Jadpo main at a707efb.