Currently the few times that we need to use SQLite transactions we don't handle at all an error in the system, meaning that we don't rollback immediately by rely on the fact that SQLite may rollback the transaction on it's own later.
What
Design a lightweight Transaction system that wrap an SQLite connection and automatically rollback when it goes out of scope if the transaction is still active (an active transaction is a transaction has still yet to be rolled back or committed).
How
[x] Add a Transaction struct that wrap a SQLite connection and define a light API to do commits or rollbacks.
[x] Implement Drop on the Transaction struct that automatically run a rollback if the transaction was still active ().
Why
Currently the few times that we need to use SQLite transactions we don't handle at all an error in the system, meaning that we don't rollback immediately by rely on the fact that SQLite may rollback the transaction on it's own later.
What
Design a lightweight
Transaction
system that wrap an SQLite connection and automatically rollback when it goes out of scope if the transaction is still active (an active transaction is a transaction has still yet to be rolled back or committed).How
Transaction
struct that wrap a SQLite connection and define a light API to do commits or rollbacks.Drop
on theTransaction
struct that automatically run a rollback if the transaction was still active ().