skip to Main Content

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)))"

2

Answers


  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}})`);
    
    Login or Signup to reply.
  2. For the python user (#supabase-py), you can use :

    supabase.table('my_table').select('*').filter('my_colum','is', 'null').execute().data
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search