supabase-go icon indicating copy to clipboard operation
supabase-go copied to clipboard

DELETE requires a WHERE clause

Open LaughingBubba opened this issue 4 months ago • 1 comments

Hi, thanks for writing this package. I'm trying to delete all rows in a table (see below)

This:

  var results map[string]interface{}
  err := supabase.DB.From("events").Delete().Execute(&results)
  if err != nil {
    panic(err)
  }

Panics with this:

panic: 21000: DELETE requires a WHERE clause

It seems incongruous that this is required:

err := supabase.DB.From("events").Delete().Like("evt_name","*").Execute(&results)

When this just works in Postgres:

DELETE from events

Is this a bug or a feature or am I missing something?

Thanks in advance.

LaughingBubba avatar Feb 29 '24 22:02 LaughingBubba