def count_and_all(self):
    base_sql_ast = self._get_base_sql_ast(modifier='SQL_CALC_FOUND_ROWS')
    with self.db.transaction():
        cursor = self.db.get_cursor()
        rv = self._get_rv(base_sql_ast=base_sql_ast, cursor=cursor)
        cursor.ast_execute(['SELECT', ['CALL', 'FOUND_ROWS']])
        count = cursor.fetchone()[0]
    items = list(self._iter_wrap_rv(rv))
    return (count, items)
def count_and_all(self):
    base_sql_ast = self._get_base_sql_ast(modifier='SQL_CALC_FOUND_ROWS')
    with self.db.transaction():
        cursor = self.db.get_cursor()
        rv = self._get_rv(base_sql_ast=base_sql_ast, cursor=cursor)
        cursor.ast_execute(['SELECT', ['CALL', 'FOUND_ROWS']])
        count = cursor.fetchone()[0]
    items = list(self._iter_wrap_rv(rv))
    return (count, items)