migrating from supabase
hey folks, im moving RLS policies i had from supabase to pgSQL railway, and in supabase there is
auth.uid()
which fetches uid from user, what is a substitute for that so it works for pgSQL?13 Replies
@Ping if you know i'd appreciate it, sorry for tag
Migrating from Supabase Auth to Better Auth | Better Auth
A step-by-step guide to transitioning from Supabase Auth to Better Auth.
thats not what i asked tho
anyone got this?
@nikatune do you know by any chance
i dont know sir
okay
by pgSQL you mean raw sql query or like using some orm?
you can get userid from session
Session Management | Better Auth
Better Auth session management.
raw yes
yes but like, i have trigger functions inside postgresql, thats why i need it
Are you sure you need trigger functions now that you use better auth? I was using supabase auth and that forced me to use quite a few triggers to create profiles when users signed up with oauth for example. But with better auth I can have full control of the flow through my server side code interacting with the database. Which I believe is preferred over triggers/functions as you can follow your whole data flow server side
i actaully do need it yeah, but i have trigger functions that work without auth.uid
i just needed them for RLS, but seems i can do just fine without them, as how its currently going
@In&Out @WiFi Plug Hi guys, are you able to have the supabase client authenticated on the browser to use supabase storage or supabase realtime with better auth ?
You can login with supabase client if you mean that
And you can send into storage but i recommend you server, not sure what kind of interactivity you need
so you are able to have RLS with better auth ?
how do you authenticate the Supabase Client ?