Set the maximum number of rows that can be affected by an update or delete operation. If the query would affect more rows than the specified limit, the operation will fail with an error.
This uses PostgREST's Prefer: max-affected header with handling=strict.
The maximum number of rows that can be affected
response = (
supabase.table("planets")
.update({"name": "Updated"})
.eq("id", 1)
.max_affected(1)
.execute()
)
response = (
supabase.table("planets")
.delete()
.eq("id", 1)
.max_affected(1)
.execute()
)