Dynamic columns inside RPC function
I need to do a simple query: SELECT [columns_list], SUM(column) FROM table GROUP BY [columns_list]
Of course GROUP BY is not available using Supabase JS Client.
So, I'm trying to write an RPC function, but I'm struggling with allowing a variable columns list as an argument of the function.
Something like this works, but allows only one column at a time, and probably is something that I can't use with Supabase JS client, because the query is something like this:
Is there any solution that I'm missing? I can create a NextJS API with a custom Prisma query, but I prefer a solution with an RPC call, if there's one.
Of course GROUP BY is not available using Supabase JS Client.
So, I'm trying to write an RPC function, but I'm struggling with allowing a variable columns list as an argument of the function.
Something like this works, but allows only one column at a time, and probably is something that I can't use with Supabase JS client, because the query is something like this:
Is there any solution that I'm missing? I can create a NextJS API with a custom Prisma query, but I prefer a solution with an RPC call, if there's one.