Sets the most rows an Update() or Delete() may affect. If the mutation would affect more rows, PostgREST rolls it back and the call throws.
PostgrestException with Reason set to FailureHint.Reason.MaxAffectedExceeded.ArgumentOutOfRangeException. A value of zero forbids any affected row.Update() or Delete() throws an InvalidOperationException.await supabase
.From<City>()
.Filter("country_id", Operator.Equals, "554")
.MaxAffected(10)
.Delete();
try
{
await supabase
.From<City>()
.Where(x => x.CountryId == 554)
.Set(x => x.Name, "Renamed")
.MaxAffected(5)
.Update();
}
catch (PostgrestException ex) when (ex.Reason == FailureHint.Reason.MaxAffectedExceeded)
{
// More than 5 rows matched, nothing was changed.
}