Sets the maximum number of rows that can be affected by the query. Only effective with PATCH and DELETE operations. Requires PostgREST v13 or higher.
When the limit is exceeded, the query will fail with an error. This provides a safety mechanism to prevent accidentally affecting more rows than intended.
The maximum number of rows that can be affected by the query.
await supabase
.from('users')
.update({'active': false})
.eq('status', 'inactive')
.maxAffected(5);
await supabase
.from('users')
.delete()
.eq('active', false)
.maxAffected(10);
final data = await supabase
.from('users')
.update({'status': 'INACTIVE'})
.eq('id', 1)
.maxAffected(1)
.select();