def get_sql_result_as_dict_list(res):
    """Returns the result set as a list of dicts

    Args:
        res: (object): The sql result set

    Returns:
        A list of dicts
    """

    if not res:
        return []

    col_names = res.get_column_names()
    rows = res.fetch_all()
    dict_list = []

    for row in rows:
        item = {}
        for col_name in col_names:
            item[col_name] = row.get_field(col_name)
        dict_list.append(item)

    return dict_list