Skip to content

RLS and Supabase #559

@user72356

Description

@user72356

I'm using Supabase and I have recently enabled RLS. So far postgres.js has been working great as my DB client of choice in my API endpoints, but now that I have RLS enabled, I'm not sure how to issue queries as a Supabase user (auth.users table). I do use the Supabase JS client to retrieve the current user but I'm not sure what to do next. I've heard SET LOCAL current_user_id = XXX was an option but I'm not sure whether 1. it's working and 2. it's secure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions