Update
back to query /// home
Modify existing rows in a table.
Request
{
"action": "update",
"table": "items",
"data": {
"price": 29.99,
"status": "active"
},
"filter": {
"column": "id",
"op": "=",
"value": 42
}
}
Fields
| Field | Type | Required | Notes |
|---|---|---|---|
action |
string | yes | must be "update" |
table |
string | yes | target table |
data |
object | yes | column value pairs to update |
where |
object | yes* | simple key value filter |
filter |
object | yes* | structured filter |
*at least one of where or filter is required. you cant do an unfiltered update.
Response
{
"success": true,
"rows_affected": 1
}
Behaviors
- a WHERE clause is mandatory. the server refuses to run an update without one. this is a safety thingy yk
- columns you dont have write access to are silently stripped.
warningis included if json derulo stripped for you last_modified_byauto set to your user IDlast_modified_atis handled by sqls ON UPDATE trigger- ownership scoping applies: if you have
rwoyou can only update rows wherepinned_toequals your user ID uness you have rwa. same deal withrwgfor group scoping - limit is applied if set and capped to your max
- auto generation rules apply on update too if configured for the update action
