mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +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
|
end
|
||||||
|
|
||||||
function ptab:rewrite()
|
function ptab:rewrite()
|
||||||
|
exec(self, "BEGIN EXCLUSIVE TRANSACTION")
|
||||||
exec(self, "DELETE FROM table_entries")
|
exec(self, "DELETE FROM table_entries")
|
||||||
self.highest_table_id = 0
|
self.highest_table_id = 0
|
||||||
self.table_ids = {}
|
self.table_ids = {}
|
||||||
self.counts = {}
|
self.counts = {}
|
||||||
add_table(self, self.root)
|
add_table(self, self.root)
|
||||||
|
exec(self, "COMMIT TRANSACTION")
|
||||||
end
|
end
|
||||||
|
|
||||||
function ptab:set(table, key, value)
|
function ptab:set(table, key, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user