▲ | hu3 4 days ago | ||||||||||||||||||||||||||||||||||
I love SQLite but how would batching work in CRUD apps where you need to rollback a dozen SQL inserts/updates in case of error in a request? Also I often need to read-after-write during the same request, using transactions. And rails apps are often CRUDy. | |||||||||||||||||||||||||||||||||||
▲ | andersmurphy 4 days ago | parent [-] | ||||||||||||||||||||||||||||||||||
With a single writer (as it the case with sqlite). You don't need transactions and rollbacks. As all writes happen in sequence. Each batch item can be a combination of read/write/update that happen in sequence and therefore can give you the same semantics as a traditional transaction/rollback. eg: - read -> Does the account have enough funds? - write -> transfer 100$ from this user to another account This is also much simpler to write than in other databases as you don't have to worry about n+1. | |||||||||||||||||||||||||||||||||||
|