From 3b7aa42e0b76f68ee95520190c0cb60647e6e805 Mon Sep 17 00:00:00 2001 From: alemidev Date: Thu, 25 Aug 2022 20:50:43 +0200 Subject: [PATCH] fix: delete from namespaced storage when putting... --- src/treepuncher/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treepuncher/storage.py b/src/treepuncher/storage.py index 09a1f19..5b7d0ab 100644 --- a/src/treepuncher/storage.py +++ b/src/treepuncher/storage.py @@ -38,7 +38,7 @@ class AddonStorage: def put(self, key:str, val:Any) -> None: cur = self.db.cursor() - cur.execute("DELETE FROM documents WHERE name = ?", (key,)) + cur.execute(f"DELETE FROM documents_{self.name} WHERE name = ?", (key,)) cur.execute(f"INSERT INTO documents_{self.name} VALUES (?, ?)", (key, json.dumps(val, default=str),)) self.db.commit()