Partial updates — AQL
Partial updates
Section titled “Partial updates”An optional parameter ($name?) in a set clause is plain nullable: when the value is null, the
column is written to NULL. (This differs from an optional parameter in a filter, where null
skips the condition — see Optional parameters.)
To leave a column unchanged when a value is absent, coalesce the parameter to the column’s
current value with ?? .field:
update Applicationfilter .id = $idset { status := $status?, # null → sets the column to NULL build_system := $build_system? ?? .build_system # null → keeps the current value};-- $1: status-- $2: build_system-- $3: idUPDATE "application" a SET status = $1, build_system = COALESCE($2::TEXT, a.build_system)WHERE a.id = $3RETURNING *;The ?? cast ($2::TEXT here) is the column’s SQL type, so the parameter’s type is determinable
even when its value is null.