- def pull(self, statement):
- with self.connection.execute(statement, 1) as cursor:
- return cursor.fetchall()
-
- 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
-
- def push(self, statement):
- with self.connection.execute(statement, 1) as cursor:
- pass
-
- def push_(self, statement, locals):
- with self.connection.execute_(statement, locals) as cursor:
- pass
-
- def exists(self, statement):
- return self.yank('''
- select exists (
- {statement}
- )
- '''.format(**locals()), 1)[0]
+ def has(self, statement):
+ return one(self.one_('select exists(%s)' % (statement,)))