Best way to perform complex queries?
I have a query that I don't think the supabase-js client can perform directly:
It seems the recommended solution is to put the query in a postgress function and call it with the supabase client's
I could connect directly to the database (eg with the node-postgres library) and run the query that way. Is there a downside to this? The action is performed by the server with the service key so RLS is irrelevant for me.
select * from worksheet where id in (select worksheet from "profilesWorksheet" where profile = 'some-id')It seems the recommended solution is to put the query in a postgress function and call it with the supabase client's
rpc function. This would work but its annoying to have an extra step. Also currently my postgress setup isnt in version control, so id rather have the query in my node server code not in postgress.I could connect directly to the database (eg with the node-postgres library) and run the query that way. Is there a downside to this? The action is performed by the server with the service key so RLS is irrelevant for me.