tocc
tocc copied to clipboard
Transactions
Client of libtocc should have an option to start and then commit/rollback transactions.
For example, if user passes --import and --assign to the CLI, the CLI will first import files and then assign tags to them. What if the second action fails? Or worse, after some files are imported, it fails to import others.
There's a lot of other situations we need transactions.
Things to consider:
- UnQlite supports transactions. But we also need transactions in file system layer.
- We should design a clean and easy-to-use interface for starting and ending transactions.
Discuss your ideas here.
A note about the number 2 above: Beside the methods to start/commit/rollback transactions, there should be a way to auto-manage a transaction. Something like Python's with keyword, or C#'s using keyword.