Closed Alexnortung closed 1 year ago
supabase.from('venue_access').delete().eq('user_id', 1).neq('venue_id', [1,2,3]);
Try using in with not instead of neq
.
{ "code":"22P02", "details":null, "hint":null, "message":"invalid input syntax for type bigint: \"1,2,3\"" }
The error is telling that you can't compare with equality a bigint with a bigint array.
Thanks alot this works. I solved it by
supabase.from('venue_access').delete().eq('user_id', 1).not('venue_id', 'in', `(${[1,2,3].join(',')})`);
Sorry I reported it as a bug, I guess the error description just didn't make sense to me
Bug report
Describe the bug
It seems that it is not possible to delete multiple records with the supabase client.
In my project I have a table called
public.venue_access
with a composite primary key(user_id, venue_id)
and my own users table with extra informationpublic.users
. I want to set which venues the user can alter in the venue access table. I want to it like in the following example.The upsert part work perfectly and inserts the missing records. However the delete part fails and I get the following error
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
I expected the records to be deleted with no errors.
Screenshots
Not relavant
System information
Additional context
The http request is: