Menu

Why your Supabase query returns nothing, with no error (3 common causes)
📰

Why your Supabase query returns nothing, with no error (3 common causes)

DEV Community: postgres·Masaru Nishino·7 days ago
#nJBnHQv1
#devtopostgresql#devto#dev#demo#user
Long article (796 words) — no AI summary yet.
Reading 0:00
15s threshold

"The data is in the table, but my app shows nothing."

This is one of the most common Supabase questions, especially in apps built with Lovable, Bolt or Cursor. And it's hard to search for, because there is no error. The query succeeds. It just returns [] .

Almost every time, the cause is Row Level Security (RLS).

Why the dashboard looks fine

The SQL Editor in the Supabase dashboard runs as a database admin, so it skips RLS. Your app doesn't. It runs as anon (not signed in) or authenticated (signed in), and RLS decides which rows that user can see.

So the same query can return 5 rows in the dashboard and 0 rows in your app. Both are "correct".

To reproduce this, I wrote a small script against a local Supabase. It creates a notes table with 5 rows: 3 belong to client A, 2 belong to client B. Then it signs in as client A and runs the query three different ways.

In all three cases, the app got 0 rows and no error , while a direct Postgres count showed 5 .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.