Update sqlite3/db.py

This commit is contained in:
2024-08-23 08:07:11 -04:00
parent db0af1a6a3
commit 0db070bcf2

View File

@@ -49,4 +49,13 @@ class DB(sqlite3.Connection):
''', (pattern,)).fetchall()
return [row[0] for row in result]
def __repr__(self): return repr(self.keys())
def __repr__(self): return repr(self.keys())
def exists(self, key):
with self:
cur = self.execute('''
SELECT 1 FROM kv_store
WHERE key = ?
LIMIT 1
''', (key,))
return bool(cur.fetchone())