from typing import OrderedDict


def dictify_row(cursor, row):
    """
    Turns the given row into a dictionary where the keys are the column names.

    :param cursor: the database cursor
    :param row: the current row
    :return: dictionary with keys being column names
    """
    d = OrderedDict()
    for i, col in enumerate(cursor.description):
        d[col[0]] = row[i]
    return d