Skip to main content
Version: v1

Delete data: delete()

Performs a DELETE on the table.

const { data, error } = await supabase
.from('cities')
.delete()
.match({ id: 666 })

Parameters

  • __namedParametersrequiredobject

    No description provided.

      Properties
    • countoptionalliteral | exact | planned | estimated

      No description provided.

        Properties
      • estimatedrequiredliteral

        No description provided.

      • plannedrequiredliteral

        No description provided.

      • exactrequiredliteral

        No description provided.

      • nullrequiredliteral

        No description provided.

    • returningoptionalminimal | representation

      No description provided.

        Properties
      • representationrequiredliteral

        No description provided.

      • minimalrequiredliteral

        No description provided.

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 through SELECT policies are deleted. Note that by default no rows are visible, so you need at least one SELECT/ALL policy that makes the rows visible.

Examples

Delete records

const { data, error } = await supabase
.from('cities')
.delete()
.match({ id: 666 })