Open
Description
Feature request
Is your feature request related to a problem? Please describe.
Transactions are a fundamental concept of all database systems. The essential point of a transaction is that it bundles multiple steps into a single, all-or-nothing operation. The intermediate states between the steps are not visible to other concurrent transactions, and if some failure occurs that prevents the transaction from completing, then none of the steps affect the database at all.
Describe the solution you'd like
Implement an easy way to create transactions. Something like:
db.runTransaction(() {
// run the operations here
})
Describe alternatives you've considered
Create a rpc function that runs the commands. This is suitable for small apps, but wouldn't work for large apps, since multiple functions would be created.
Additional context
supabase/supabase-dart#60
https://www.postgresql.org/docs/8.3/tutorial-transactions.html
supabase/supabase#526