sqlite cache: make key as primary key

This commit is contained in:
norohind 2022-04-03 23:40:35 +03:00
parent 8a9fe54f6d
commit 8e82a6aa48
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

View File

@ -25,7 +25,7 @@ class Cache:
self.db.row_factory = lambda c, r: dict(zip([col[0] for col in c.description], r))
with self.db:
self.db.execute("create table if not exists cache (key text unique, value text);")
self.db.execute("create table if not exists cache (key text primary key, value text);")
def set(self, key, value) -> None:
if self.disabled: