0

I want to write an SELECT statement using Supabase-JS library, where it would return all rows whose associated_campaigns (array of UUIDs) column is either null or doesn't contain input string.

I'm trying with something like this, where campaign_id is input parameter, but without success:

supabase.from("linkedin_leads").select("*").or(`associated_campaigns.is.null,not(associated_campaigns.cs.${campaign_id})`);

Error returned is:
"failed to parse logic tree ((associated_campaigns.is.null,not(associated_campaigns.cs.e04a95fc-47bd-4c88-8e97-ad48711ee8d9)))"
kecman
  • 813
  • 3
  • 14
  • 34

2 Answers2

1

Looking at the docs for contains, it looks like you might have to wrap your campaign_id in {} like this:

supabase.from("linkedin_leads")
  .select("*")
  .or(`associated_campaigns.is.null,not(associated_campaigns.cs.{${campaign_id}})`);
dshukertjr
  • 15,244
  • 11
  • 57
  • 94
0

For the python user (#supabase-py), you can use :

supabase.table('my_table').select('*').filter('my_colum','is', 'null').execute().data