mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-22 21:32:27 +01:00
SQLite persistence: Wrap rewrite in transaction
This commit is contained in:
parent
5bce5c79cc
commit
b7ae328aab
@ -230,11 +230,13 @@ CREATE TABLE IF NOT EXISTS table_entries (
|
||||
end
|
||||
|
||||
function ptab:rewrite()
|
||||
exec(self, "BEGIN EXCLUSIVE TRANSACTION")
|
||||
exec(self, "DELETE FROM table_entries")
|
||||
self.highest_table_id = 0
|
||||
self.table_ids = {}
|
||||
self.counts = {}
|
||||
add_table(self, self.root)
|
||||
exec(self, "COMMIT TRANSACTION")
|
||||
end
|
||||
|
||||
function ptab:set(table, key, value)
|
||||
|
Loading…
Reference in New Issue
Block a user