blackbeam / mysql_async

Asyncronous Rust Mysql driver based on Tokio.
Apache License 2.0
372 stars 113 forks source link

annotate `Transaction` with `must_use` #290

Closed petrosagg closed 4 months ago

petrosagg commented 5 months ago

It turns out it's easy to get confused and thing that you're running queries inside a transaction when in fact the transaction object gets dropped and will be implicitly rolled back when the connection terminates. Over at Materialize we just spend multiple days trying to understand why our consistency assumption weren't holding and it turned out we were dropping the transaction object on the floor.

This PR adds a must_use annotation as an aid to developers that they need to do something with the return value of start_transaction.