import sqlite3


def dict_factory(cursor: sqlite3.Cursor, row: sqlite3.Row) -> dict:
    """Makes so that the cursor is a list of dictionaries with column names as keys

    Args:
        cursor (sqlite3.Cursor): cursor generated by the database
        row (sqlite3.Row): rows of the database

    Returns:
        dict: structure of the database used used by the cursor
    """
    d = {}
    for idx, col in enumerate(cursor.description):
        d[col[0]] = row[idx]
    return d