© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
Deleted User

Best way to perform complex queries?

I have a query that I don't think the supabase-js client can perform directly:
select * from worksheet where id in (select worksheet from "profilesWorksheet" where profile = 'some-id')
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
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.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Best way to manage user plan/tier (access token/app metadata/ DB queries)
SupabaseSSupabase / help-and-questions
7mo ago
Best way to handle realtime connections?
SupabaseSSupabase / help-and-questions
6mo ago
Best way to handle bad login
SupabaseSSupabase / help-and-questions
3y ago
Best way to implement anonymous access?
SupabaseSSupabase / help-and-questions
3y ago