Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE requires a WHERE clause #48

Open
LaughingBubba opened this issue Feb 29, 2024 · 1 comment
Open

DELETE requires a WHERE clause #48

LaughingBubba opened this issue Feb 29, 2024 · 1 comment

Comments

@LaughingBubba
Copy link

LaughingBubba commented Feb 29, 2024

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.

@namzug16
Copy link

supabase-go is simply trying to mimic the original supabase APIs

as you can see here on their js docs a filter is always required when performing a DELETE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants