cloudflare / workers-rs

Write Cloudflare Workers in 100% Rust via WebAssembly
Apache License 2.0
2.53k stars 269 forks source link

[Feature] D1 Transactions #349

Open TonyGiorgio opened 1 year ago

TonyGiorgio commented 1 year ago

Is there an existing issue for this?

Description

Could some rust bindings for this transaction feature be added?

JorgeAtPaladin commented 11 months ago

Fyi, as far as I know, D1Database.batch gets executed as a transaction. It doesn't allow you to do stuff in-between though of course, but odds are likely this serves your needs?

isaac-mcfadyen commented 11 months ago

The stored procedure-style transactions described in that blog post aren't currently implemented - instead, any calls to the D1 batch APIs are automatically run in a transaction (i.e. BEGIN, ROLLBACK, or COMMIT won't work).