Skip to content

fix: replace .single() with .maybeSingle() in SupabaseDB.get() to handle missing rows#4599

Merged
whysosaket merged 1 commit intomem0ai:mainfrom
SaharshPatel24:fix/supabase-single-to-maybeSingle-4596
Apr 1, 2026
Merged

fix: replace .single() with .maybeSingle() in SupabaseDB.get() to handle missing rows#4599
whysosaket merged 1 commit intomem0ai:mainfrom
SaharshPatel24:fix/supabase-single-to-maybeSingle-4596

Conversation

@SaharshPatel24
Copy link
Copy Markdown
Contributor

Fixes #4596

Problem

SupabaseDB.get(vectorId) used .single() which throws PGRST116 when no row exists. A missing row is not an error — it's a valid not-found case.

Fix

Replace .single() with .maybeSingle() on line 270 of supabase.ts. This returns null instead of throwing when no row is found, which is already handled correctly by the if (!data) return null check.

@whysosaket whysosaket merged commit 713dba5 into mem0ai:main Apr 1, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSS Supabase vector store: get(vectorId) uses .single() and throws PGRST116 on missing rows

3 participants