© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
12 replies
Silver.

Checking if a row with the same element already exists

Hello, I am new to supabase and I struggle with update and insert(in a database). I need to be able to update a row if the row already exist and insert it if it doesn't exists. I tried using the command upsert but it didn't work. (I might have used it wrong but i couldn't find an exemple of it with 2 different confilcts) . So I using delete and insert but it didn't work either. Does anyone knows how I can make some kind of if to check if a row with the same 'user' and 'letter' has been already inserted into the database ?
Here's a screenshot of my database and code to make it a little bit more understandable :

(Sorry if my question is not well written I am not a native speaker.)
unknown.png
unknown.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Check if row already exists with RLS.
SupabaseSSupabase / help-and-questions
4y ago
Is there a simple way of checking if a row exists
SupabaseSSupabase / help-and-questions
14mo ago
Newb here, does anybody have experience with checking if a row exists in a db function?
SupabaseSSupabase / help-and-questions
4y ago
Odd Error StorageApiError The resource already exists
SupabaseSSupabase / help-and-questions
4y ago