Add Supabase UI for Managing RPC
See original GitHub issueFeature request
Add an ability to manage RPC via UI and not Raw SQL editor. (Kinda like creating table, column or row)
Is your feature request related to a problem? Please describe.
A developer experience problem.
Writing RPC
via Raw SQL Editor
has some drawbacks even if you uses PLV8
. It has still some learning curve going in for beginners and for others that are transitioning to SQL language.
Also its really hard to maintain a RPC via just raw sql editor because mainly most of the write operations are transactional by default we cant achieve that via client side SDK (so the solution is to use RPC)
Describe the solution you’d like
- View current list of
RPC
just like viewing the list of tables - Create a
RPC
like creating table, column, or row viaform
A clear and concise description of what you want to happen. Lets see this 3 examples from the community:
create or replace function vote(quote_id int, increment_num int)
return void as $$
update my_table_name
set which_field = which_field + increment_num
where field_id = quote_id
$$ language sql volatile;
CREATE OR REPLACE FUNCTION public.topup(user text, amount integer)
RETURNS integer LANGUAGE 'plpgsql' AS $$
begin
update users set balance = balance + amount;
insert into "transactions" (user, amount, note) values (user, amount, 'top up');
return 1;
end
$$;
create or replace function auth.uid()
returns uuid as $$
select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid;
$$ language sql stable;
Common fields needed
- Function Name (vote, topup, auth.uid)
- Function Params (param name & param type) = Just like adding table columns
- Function Return type
- Function body ($$ >here goes the sql body or PLV8< $$)
- Language dropdown (SQL or PLV8) with some description display of what this does
Maybe we can make a Input form to this and a UI Maybe after that we can also generate the RPC for Supabase Client for copy paste
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
That was fast! I love developer friendly products! Im excited 😃
After all theres no so much resource about RPC in Supabase docs. Which is kinda bad for those who are not familiar with RPC But with this, I can do RPC all day