update()
Signature
builder.update(values: Partial<T>): thisAlways chain .eq() or another filter — without a filter, update() will attempt to update every row in the table.
Examples
// Update a single row by IDconst { data, error } = await massi .from('posts') .update({ title: 'Updated title' }) .eq('id', postId) .single()
// Update multiple rowsconst { data } = await massi .from('posts') .update({ published: true }) .eq('draft', false)RLS
The update must satisfy:
USING— the row must match the policy for the current user to see itWITH CHECK— the updated row must still satisfy the policy
Response
{ data: T[] | null, // The updated rows error: MassiError | null,}