1
Feature Request: Port storage functions to plpgsql
Source: supabase/supabase#29317 · opened by @purpleKarrot
Functions like signObjectUrl are currently [implemented in typescript]( and have to be called through the REST API:
If I want to display a list of users with their avatars, I have to make two requests:
1. get the list of users from supabase (postgrest).
2. get the signed URL for each avatar from supabase.storage.
Both requests eventually query the same database. It would be nice if there was a way to avoid this roundtrip.
Example: If signObjectUrl was implemented in plpgsql, I would expect being able to use it like this:
Then, requesting a list of users, each with a signed URL for their avatar could be retrieved in a single query:
My recommendation would be to port most (/all?) of the storage functions to plpgsql and reimplement the storage REST API on top of them.
If I want to display a list of users with their avatars, I have to make two requests:
1. get the list of users from supabase (postgrest).
2. get the signed URL for each avatar from supabase.storage.
Both requests eventually query the same database. It would be nice if there was a way to avoid this roundtrip.
Example: If signObjectUrl was implemented in plpgsql, I would expect being able to use it like this:
Then, requesting a list of users, each with a signed URL for their avatar could be retrieved in a single query:
My recommendation would be to port most (/all?) of the storage functions to plpgsql and reimplement the storage REST API on top of them.
No pledges yet. Be the first to back this.
Comments
Similar requests
Add option to `supabase functions deploy` to delete non-local functions
2 votes · 0 comments
Add Storage Adapter For Chrome.Local.Storage Api
3 votes · 0 comments
Replace Deno Runtime for Edge Functions with Dapr
11 votes · 0 comments
Improving the functionality of Edge Functions
3 votes · 0 comments
Edge functions not showing in local Supabase Studio
15 votes · 0 comments
No comments yet.