"Supabase Realtime Filter: Only Subscribe to Rows You Need"
"Learn the Supabase realtime filter in Flutter: eq, neq, and in operators, multiple filters, RLS gotchas, and runnable onPostgresChanges examples."
The moment your chat app subscribes to the entire messages table, every phone in every chat room starts downloading everyone else's messages. Battery drains, data bills climb, and your users see a flicker of rows they were never supposed to receive. A Supabase realtime filter fixes this at the source: it tells the server to forward only the rows that match your condition — one room, one user, one order — so the client never sees the rest. This guide shows you how filters work in Flutter with supabase_flutter 2.18.x: the eq filter for a single chat room, filtering by the signed-in user's ID, combining multiple filters on one channel, the full operator list, and the RLS and replica-identity gotchas that silently break filtered subscriptions. Last updated: October 3, 2026 What you'll learn How a server-side filter on onPostgresChanges cuts WebSocket traffic The eq filter for subscribing to a single room's messages How to filter a realtime subscription by user ID Combining multiple filters on one channel ( neq , in , stacked callbacks) Every PostgresChangeFilter operator: eq , neq , gt , gte , lt , lte , in , is Why filters are not a security boundary (RLS still applies) Why filtered UPDATE and DELETE events need REPLICA IDENTITY FULL Supabase Realtime Filter in Flutter: How It Works A realtime channel without a filter is a firehose: onPostgresChanges with event: PostgresChangeEvent.all on the messages table forwards every insert, update, and delete in that table to the client. The filter narrows the firehose on the server side , using the same operator syntax as PostgREST: column=eq.value -- equals column=neq.value -- not equals column=in.(a,b,c) -- in a list In Dart you express this with PostgresChangeFilter : filter: PostgresChangeFilter( type:…