async def METHOD_NAME(q: Q, table = 'issues', columns = ['text', 'status'], count_only = False) -> List:
    sql_query = f'SELECT {"count(*)" if count_only else ", ".join(columns)} FROM {table}'
    substitution_values = []
    # Filter out all rows that do not contain searched string.
    if q.client.search:
        search_val = q.client.search['value'].lower()
        cols = q.client.search['cols']
        like_statements = []
        for col in cols:
            if col in columns:
                substitution_values.append('%' + search_val + '%')
                like_statements.append(f'{col} LIKE ?')
        sql_query += ' WHERE (' + ' OR '.join(like_statements) + ')'
    # Filter out rows that do not contain filtered column value.
    if q.client.filters:
        filter_queries = []
        for col, filters in q.client.filters.items():
            if col in columns:
                like_statements = []
                for f in filters:
                    substitution_values.append(f'%{f}%')
                    like_statements.append(f'{col} LIKE ?')
                if like_statements:
                    filter_queries.append(' OR '.join(like_statements))
        if filter_queries:
            sql_query += ' AND ' if 'WHERE' in sql_query else ' WHERE '
            sql_query += ' AND '.join(filter_queries)
    # Sort by multiple columns.
    if q.client.sort:
        # NOTE: This example sorts alphabetically since only "text" col is sortable.
        sort_statements = []
        for col, asc in q.client.sort.items():
            if col in columns:
                sort_statements.append(f'{col} {"ASC" if asc else "DESC" }')
        if sort_statements:
            sql_query += ' ORDER BY ' + ', '.join(sort_statements)
    if not count_only:
        sql_query += f' LIMIT {rows_per_page} OFFSET {q.client.page_offset or 0} '
    results, err = await q.app.db.exec(sql_query, *substitution_values)
    if err:
        raise RuntimeError(f'Failed querying the table data: {err}')
    return results