fallback to string

This commit is contained in:
əlemi 2022-04-25 15:36:05 +02:00
parent f0c34376fa
commit 91afbbc28a
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -87,6 +87,6 @@ class Storage:
def put(self, key:str, val:Any) -> None:
cur = self.db.cursor()
cur.execute("DELETE FROM documents WHERE name = ?", (key,))
cur.execute("INSERT INTO documents VALUES (?, ?)", (key, json.dumps(val)))
cur.execute("INSERT INTO documents VALUES (?, ?)", (key, json.dumps(val, default=str)))
self.db.commit()