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.

Return values for supabase.rpc

See original GitHub issue

The docs say the return values of supabase.rpc are { data, error }. But I am getting the return values as { body, status, statusCode, statusText }

// this works
const { body, status, statusCode, statusText } = await supabase.rpc('funcName', params); 

// this doesn't
const { data, error } = await supabase.rpc('funcName', params); 

Should we update the docs? Or we can consider changing the return values to data and error to keep it consistent with the other supabase-js functions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kiwicopplecommented, Feb 12, 2021

Just a patch release - we won’t remove body, we will just assign it to data too. But we will need to make sure the change is coming from postgrest-js, then bubbling up through supabase-js.

0reactions
iniancommented, Feb 13, 2021

Ohh, I was using it in monitoring and looks like it is still on supabase-js v0.35.10. My bad…closing the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Custom function query returns different value from RPC call
Custom function query returns different value from RPC call. ... const { data, error } = await supabase.rpc("get_daily_mr_counts", ...
Read more >
Supabase - RPC function returning null instead of values
I've created a Supabase RPC function in order to process a structured query on my Supabase database and in order to call the...
Read more >
Using Stored Procedures (RPC) in Supabase to Increment a ...
In my recent side project, Lila, I wanted a simple way to increment a “Like” counter for the quotes on the site. As...
Read more >
Dynamic RPC function : r/Supabase - Reddit
I am looking to create an RPC for grabbing distinct values of a column but I am going to be doing this across...
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