ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
6 replies
hausofalejandro

Transactions in Edge Functions

Hello everyone! ๐Ÿ‘‹๐Ÿป

I was wondering if there's any way to write an Edge Function that behaves like a transaction.

I do have logic in my Database Functions and what I really find valuable of this way is that if any operation inside that function fails; the entire transaction fails and "reverse" any other writes to the database, ensuring that I perform an atomic operation once calling that RPC.

On the other hand, what I don't enjoy a lot of this is that I need to write all of that logic in pgplsql, I'll prefer to have it written in TypeScript. But as long as I understand, the Edge Functions doesn't behave like a transaction when I have multiple operations inside (eg. a couple of inserts and updates), if any of these fails, the others that succeed will not rollback, ending with inconsistent data and undesired results.

So, is there any way to this approach, or any other recommendation? Thanks a lot!
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

Directories in edge functions.
SupabaseSSupabase / help-and-questions
4y ago
Edge Functions
SupabaseSSupabase / help-and-questions
4mo ago
Edge Functions
SupabaseSSupabase / help-and-questions
13mo ago
Scheduling Edge Functions (in 2026)
SupabaseSSupabase / help-and-questions
3w ago