-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
Hey folks! I read this:
https://starbasedb.com/blog/developing-acid-transaction-support-in-starbasedb/
This is really impressive engineering! But, thought you might want to know... Durable Objects has a built-in transaction API.
this.ctx.storage.transactionSync(() => {
// do some sql here
this.ctx.storage.sql.exec(...);
// If the callback returns normally, the transaction is committed.
// If an error is thrown, the transaction is rolled back.
});It's totally our (Cloudflare's) fault that you didn't see this -- the error message thrown by BEGIN TRANSACTION fails to explain it, and it looks like we totally forgot to update the docs to cover the new transactionSync() API, or how the older async transaction() API interacts with SQL.
Using the transaction API will, of course, be much more efficient than using PITR for rollbacks.
So sorry that our documentation error led you to put so much effort into building a work-around. :/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels