-
-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Here is the actual type of all roles, and me trying to use it. You can see it is correctly an array and has no null value in it.
However, I get this error, which says I can't set a single value to an array. Clearly, other parts of Supabase knows this IS an array.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a computed function that returns a
SETOF
of any table. - Try to use it inside the original
An easy test would be to create a computed function on the profiles
table that returns a SETOF any other table records (see below).
Expected behavior
I shouldn't need to use override at all, but the return value is single and possibly null outside the box. Here is what it looks like.
Function
Here is my actual computed function, but it could be any table.
CREATE OR REPLACE FUNCTION public.all_roles(profiles)
RETURNS SETOF public.roles
LANGUAGE sql
SET search_path = ''
AS $$
SELECT * FROM public.roles;
$$;
The purpose of this, of course, is to be able to query the database once and remove extraneous fetches.
System information
"@supabase/ssr": "^0.6.1",
"@supabase/supabase-js": "^2.49.8"
Additional context
I think BOTH override needs to be fixed and the original type problem.
J