Update sqlite3/db.py
This commit is contained in:
@@ -50,3 +50,12 @@ class DB(sqlite3.Connection):
|
|||||||
return [row[0] for row in result]
|
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())
|
||||||
Reference in New Issue
Block a user