with self.connection.execute(statement, 1) as cursor:
return cursor.fetchall()
- def yank(self, statement):
- with self.connection.execute(statement, 1) as cursor:
+ def yank(self, statement, offset=0):
+ with self.connection.execute(statement, 1 + offset) as cursor:
rows = cursor.fetchall()
return rows[0] if len(rows) != 0 else None
with self.connection.execute(statement, 1) as cursor:
pass
+ def exists(self, statement):
+ return yank('''
+ select exists (
+ {statement}
+ )
+ ''')[0]
+
@contextmanager
def connect(dsn):
attempt = 0