Skip to content

Instantly share code, notes, and snippets.

View rickwargo's full-sized avatar

Rick Wargo rickwargo

View GitHub Profile
@mansueli
mansueli / testing_rls_supabase.mdx
Last active June 12, 2025 22:16
Testing Row Level Security (RLS) policies @supabase

Testing RLS policies

To test policies on the database itself (i.e., from the SQL Editor or from psql) without switching to your frontend and logging in as different users, you can utilize the following helper SQL procedures (credits):

grant anon, authenticated to postgres;

create or replace procedure auth.login_as_user (user_email text)
    language plpgsql
    as $$