def dictfetchone(cursor):
    """convert SQL result to dict instead of a list."""
    columns = [col[0] for col in cursor.description]
    result = [dict(zip(columns, row)) for row in cursor.fetchall()]
    return result[0]