supabase / realtime

Broadcast, Presence, and Postgres Changes via WebSockets
https://supabase.com/realtime
Apache License 2.0
6.69k stars 298 forks source link

Unable to use null filters like 'parent IS NULL' in supabase realtime. #659

Open sathishkannan162 opened 1 year ago

sathishkannan162 commented 1 year ago

Bug report

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '…'
  2. Click on '…'
  3. Scroll down to '…'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

Add any other context about the problem here.

const { createClient } = require('@supabase/supabase-js')

const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY, {})

// Set your custom JWT here
supabase.realtime.setAuth('your-custom-jwt')

const channel = supabase
  .channel('db-changes')
  .on(
    'postgres_changes',
    {
      event: '*',
      schema: 'public',
      table: 'todos',
      filter: 'parent IS NULL',
    },
    (payload) => console.log(payload)
  )
  .subscribe()
sathishkannan162 commented 1 year ago

Does supabase have null filters?

w3b6x9 commented 1 year ago

Does supabase have null filters?

@sathishkannan162 realtime doesn't currently support is null filters but it's something we can add to the product roadmap. will transfer this to the realtime repo.

sathishkannan162 commented 1 year ago

I would love to see this feature. It would reduce lots of unnecessary realtime messages.