RFC 0084 — One write for many rows: a column set for thousands in a request
Status: implemented (2026-11-30) · Target: 0.66.0 · builds on RFC 0077, RFC 0079 and RFC 0080 · see Decisions
Summary
RFC 0080's Set gives every selected row a column's value, a row at a time, four at once. That's right for the hundreds a selection usually is, and RFC 0080 left the rest for later: "It can come when an app has thousands to set." With every match selected (RFC 0077), thousands is one click away. Over a Laravel backend, 8,000 updates at four at a time are minutes of requests, each validating the whole record.
This RFC lets a table set one column for many rows in one request, when the app has a command for it:
<Table
page={list}
bind:query
select
{columns}
oneditrow={(row, values) => api.invoices_update(row.id, { ...inputOf(row), ...values })}
onsetmany={(ids, values) => api.invoices_update_many(ids, values)}
/>
onsetmany(ids, values): the keys and the one column's value. It resolves to what failed, if anything:{ failed: { [id]: message } }.- Used by Set (RFC 0080) and ⌘Enter on a selection, in chunks of 500 keys, with RFC 0079's progress and Cancel between chunks. Paste, fill and edits stay a row at a time: their values differ by row.
- One step to undo, as today: the undo is a set per old value, so it
goes through
onsetmanytoo. make:resourcewrites{p}_update_many(ids, input)with a{Model}Patch(every field optional, only the ones given validated and written), and the Laravel route and controller method as a hint.
Motivation
- Every match makes thousands common. RFC 0077 made "the 8,000 overdue invoices" one click; RFC 0080 made "mark them reminded" one more. The write is what's left slow.
- A row at a time validates the whole record. An update that takes the whole input checks every field of every row, when one changed. A patch checks the one.
- The server can do it in one statement.
UPDATE … WHERE id IN (…), or Eloquent'swhereKey($ids)->update(), in one transaction, with the abilities checked once per row as the app wants.
Current state (0.67)
- Set and ⌘Enter on a selection (RFC 0080) write through RFC 0079's
write of many: grouped by row,
oneditrow(oronedit) a row at a time, four rows at once, progress and Cancel past 20, failures per row, one undo step. make:resourcewrites{p}_update(id, input)taking the whole{Model}Input, validated withvalidate(&ctx, &db); over a backend,PUT /api/{p}/{id}.- Nothing writes many rows in one call.
Design
onsetmany(ids, values)
onsetmany?: (ids: Key[], values: Record<string, unknown>) =>
Promise<{ failed?: Record<string, string> } | void>
- When: a Set (or ⌘Enter on a selection) whose rows are more than
one, when
onsetmanyis given. Everything else is as RFC 0079 has it. - Chunks: 500 keys a call, one call at a time, with the progress ("Saving rows… 1,500 of 8,000") and Cancel between calls.
- Shown at once: the rows on the page show the new value with the pending dot while their chunk is written, as today.
- What failed: a key in
failedis taken back and marked, with its message, as a failed row is today. A call that throws fails its whole chunk: aValidationErrorfor the column is the message of each row in it; anything else, a toast, and the chunks after it aren't sent. - Undo: the step's cells are grouped by their value before; each
group is one
onsetmany(in chunks). Rows changed since are left, as RFC 0080 has it.
make:resource
{Model}Patch: every editable field,Option<…>(and an optional oneOption<Option<…>>, sonullis "empty it" and absent is "leave it"),#[serde(default)], validated only for the fields given.{p}_update_many(ctx, ids: Vec<key>, patch: {Model}Patch) -> Result<UpdatedMany>: with the update ability. It checks each row's ability as_updatedoes, writes the given columns for the rows that pass in one transaction, and answers{ updated: n, failed: { id: message } }. Auniquefield in a patch for more than one row is a validation error: it can't be unique.- Over a backend:
PATCH /api/{p}with{ ids, values }, and the hint for Laravel:Route::patch('{p}', [Controller::class, 'updateMany'])and a method that validates the given fields with the update request's rules ($request->safe()->only(...)), checksupdateper model, and updates in one transaction. - The list with
--inlinegetsonsetmanythrough it.
Words
savingMany(done, total) for the progress past 999 rows ("Saving rows…
1,500 of 8,000", with the locale's grouping); no other new words.
Implementation plan
ui:onsetmanyin Set and ⌘Enter on a selection: chunks, the progress, Cancel,failedmarked, a throw per chunk, and the undo grouped by old value.ratatosk:{Model}Patch,{p}_update_many,UpdatedMany, the backend request, the Laravel hint,onsetmanyin the list, and their tests and smoke.framework:UpdatedManyinelyra::db(or the prelude), if more than the generated code needs it; else generated.- Tests: a set over
onsetmanyin chunks, progress and Cancel, afailedkey, a throw with aValidationErrorand without, undo grouped by value, a paste and an edit still a row at a time; the generated command's ability per row, a patch with one field,nulland absent, a unique field refused, one transaction. - Docs:
table.md("A value for the selected rows"),resources.md, the Laravel guide, the skills, CHANGELOG.
Open questions
- Only Set, or paste and fill too? Recommendation: only Set (and ⌘Enter on a selection). One value for many rows is what one statement does; a paste's values differ by row, and is the hundreds a page holds.
- The ability per row, or once? Recommendation: per row, as
_updatedoes. An ability that depends on the record (the user's own invoices) is the common one, and once would write rows the user may not. - Chunks of 500? Recommendation: yes, one at a time. Small enough for a request's size and a transaction's time, large enough that 8,000 rows are 16 calls, and Cancel has somewhere to stop.
make:resourcewrites it by default? Recommendation: yes, with--inline: the list that sets columns is the one that edits them. Without it, nothing changes.
Decisions
Accepted 2026-11-30, with the open questions' recommendations:
- Only Set (and ⌘Enter on a selection) goes through
onsetmany; a paste and a fill stay a row at a time. - The ability is checked per row, as
_updatedoes. - Chunks of 500 keys, one call at a time.
make:resourcewrites it with--inline.
As built
As designed, with these differences:
make:resourcewrites the command for every resource, not only with--inline: it's a command like the others, gated by the update ability. With--inline, the list sets through it (onsetmany).- The ability is the update ability, checked once. A generated
command's ability is the user's, not the row's (as
_update's is); over a backend, the Laravel method checks each model's policy. - Each row is validated as its whole update, the record with the
patch over it, with the update's rules; the rows that pass are written
in one
UPDATE … WHERE id IN (…), which is one statement, not a transaction around more. - A patch sets the plain fields: text, numbers and flags. A date kept as another type, JSON, a file and a parent's key aren't in it.
- A unique field for more than one row is an error, not a field's validation message: the table says it in a toast.
- No
savingManyword: the progress is the write of many's ("Saving rows… 500 of 8000"). - Over a backend, the values are the fields given, sent by their
columns; one not given isn't sent, an optional one given as
nullis.
Not in this RFC
- A paste or a fill in one request.
- Deleting many rows in one request (a
bulkaction is the app's). - A set computed from each row (
price × 1.1).
Alternatives considered
- More rows at once (16 instead of 4). The server still validates and writes each record on its own, and a backend has a rate limit.
oneditmany(changes)for every write. RFC 0079 chose a write per row for its progress and failures; a set is the case where one value makes one statement possible.- A server-side job. Right for millions; for thousands, a request is simpler, and the user waits for the answer anyway.