4 ms·
Are batch operations automatically atomic in SQLite? SQLite makes no mention of batch operations. Looking at the library, it seems it's just using prepared sta
by jjk7 3y ago
Are batch operations automatically atomic in SQLite? SQLite makes no mention of batch operations.
Looking at the library, it seems it's just using prepared statements outside of a transaction...
https://github.com/powersync-ja/sqlite_async.dart/blob/f994e165d5410c9ccca9a187de9c51fcedfd1182/lib/src/sqlite_connection_impl.dart#L239 https://github.com/powersync-ja/sqlite_async.dart/blob/f994e...
Seems the other commenter is correct that wrapping that line in a tx will fix it.
- hinkley 3y agoWithin the DB world, “batch” usually means a sequence of queries in a single transaction. In software a batch is clumping tasks to run together with any sort of separation from other clumps. Logical, time… If you use one definition while everyone else is using the other, there’s going to be a loud and confused argument. Since we are talking about databases, we’d all better be using the former, but I suspect maybe the author is not.
- epcoa 3y agohttps://github.com/powersync-ja/sqlite_async.dart/blob/f994e165d5410c9ccca9a187de9c51fcedfd1182/lib/src/sqlite_queries.dart#L138 https://github.com/powersync-ja/sqlite_async.dart/blob/f994e... https://github.com/powersync-ja/sqlite_async.dart/blob/f994e165d5410c9ccca9a187de9c51fcedfd1182/lib/src/sqlite_database.dart#L20 https://github.com/powersync-ja/sqlite_async.dart/blob/f994e... I think you may be looking too deeply. It does look like that object will wrap in a tx.
- jjk7 3y agoAh, yeah I think you're right.