question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Supabase UI for Managing RPC

See original GitHub issue

Feature 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

  1. View current list of RPC just like viewing the list of tables
  2. Create a RPC like creating table, column, or row via form

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

  1. Function Name (vote, topup, auth.uid)
  2. Function Params (param name & param type) = Just like adding table columns
  3. Function Return type
  4. Function body ($$ >here goes the sql body or PLV8< $$)
  5. 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:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
sandbox-appscommented, Jul 16, 2021

That was fast! I love developer friendly products! Im excited 😃

4reactions
sandbox-appscommented, Jul 16, 2021

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

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Supabase Documentation
You can use supabase-js to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management...
Read more >
Supabase Documentation
You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management...
Read more >
Call a Postgres function - Supabase
You can call Postgres functions as Remote Procedure Calls, logic in your database that you can execute from anywhere. Functions are useful when...
Read more >
Call a Postgres function - Supabase
Call a stored procedure. With Parameters. This is an example invoking a stored procedure. dart final data = await supabase .rpc('hello_world'); ...
Read more >
Using Modifiers - Supabase
Some modifiers only apply for queries that return rows (e.g., select() or rpc() on a function that returns a table response).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found