The problem
"The data is in the table, but my app shows nothing." It's one of the most common Supabase questions, especially in apps built with Lovable, Bolt or Cursor. There's no error to search for: the query succeeds and returns an empty list.
Why it happens
Almost always Row Level Security. The SQL Editor in the Supabase dashboard bypasses RLS, the app doesn't. So the rows look fine in the dashboard, and the app gets nothing.
What I built
A script that reproduces the three most common causes on a local Supabase, then fixes each one.
No policy: RLS is on, but no policy lets the user read the rows.
Wrong column: the policy compares id instead of owner_id with the signed-in user.
Not signed in: the policy is for signed-in users, but the query runs before sign-in.
The result
In all three cases, the app got 0 rows and no error, while a direct Postgres count showed 5. After each fix, the signed-in client saw exactly their own 3 rows, and none of the other client's 2.
Check your own app in one minute
Run the same query in the Supabase SQL Editor. If it returns rows there but not in the app, it's RLS.
Safe by design
The script only runs against a local database: it refuses any host other than localhost, creates a temporary table, and always drops it, even if a step fails. The portal's 467 access checks still pass, locally and in GitHub Actions.
Stack
Supabase (Postgres, Row Level Security), supabase-js, Node.js.
Part of a series on the same portal: https://contra.com/p/bsO7qNQN-client-portal-with-company-roles-owners-pay-staff-view
0 likes · 3 views · Nov 25, 2026
A local script that reproduces the three most common reasons a Supabase query returns an empty list with no error, and fixes each one.