Skip to content
Discussion options

You must be logged in to vote

I far as I understand Supabase does not support returning a SETOF record directly from a PostgreSQL function. Instead, we can modify the function to return a table, which can be queried using Supabase.

CREATE or REPLACE FUNCTION get_blank_cards2(user_id uuid) RETURNS TABLE (
  deck_name character varying,
  title character varying,
  text character varying,
  translation character varying,
  topics JSON,
  items JSON,
  hints character varying[],
  audio character varying[],
  video JSON[],
  examples JSON,
  info text,
  card_type public.card_type 
) AS $$
DECLARE
  current_card_type CONSTANT public.card_type := 'blank';
BEGIN
	RETURN QUERY
		SELECT d.name AS deck_name, bc.title, bc.text…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rustkas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant