Using complex JSON functions - Supabase