Delete data: delete()
Performs a DELETE on the table.
const { data, error } = await supabase
.from('cities')
.delete()
.match({ id: 666 })
Parameters
__namedParametersrequired
object
No description provided.
returningrequired
minimal
|representation
If
true
, return the deleted row(s) in the response.countrequired
null
|exact
|planned
|estimated
Count algorithm to use to count rows in a table.
Properties
Notes
delete()
should always be combined with filters to target the item(s) you wish to delete.- If you use
delete()
with filters and you have RLS enabled, only rows visible throughSELECT
policies are deleted. Note that by default no rows are visible, so you need at least oneSELECT
/ALL
policy that makes the rows visible.
Examples
Delete records
const { data, error } = await supabase
.from('cities')
.delete()
.match({ id: 666 })