Would someone have an idea how I could leverage the Row-Level Security features when using a direct DB connection with an ORM (Knex.js/Objection.js)?
laznic
08/10/2021, 10:44 AM
I'm using a Hapi.js stack with Hapipal (https://hapipal.com) and the one thing I really love in it is the Objection.js ORM integration. It just makes DB queries so much nicer to write and all. And I'd love to use this with Supabase, too.
I've already migrated some of my data from one of my project to Supabase and it's working just fine without RLS on.
s
silentworks
08/10/2021, 10:46 AM
You don't get access to RLS when connecting to the DB directly
l
laznic
08/10/2021, 10:46 AM
Oh dang
laznic
08/10/2021, 10:48 AM
That's good to know, thank you! I'll see if there could be some other solution in my code to restrict the inserts and updates then 👍
laznic
08/10/2021, 10:48 AM
Maybe I'll have to route all the requests through my API and never expose the Supabase URI in the frontend
s
silentworks
08/10/2021, 11:00 AM
If you are working with a server side framework then that can be handled in the server code
l
laznic
08/10/2021, 11:14 AM
Yeah, gonna do that with Hapi 👍 Currently just thinking the scenario where I'd fetch private profile data for authenticated users. Probably have to make an authentication check where I check if the user is found in Supabase via the JWT whenever I receive a request in my Hapi server.