Update sqlite3/db.py
This commit is contained in:
@@ -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())
|
||||
Reference in New Issue
Block a user