def _table_pkey(cursor, table_name):
    """
    Finds out what is the name of the primary key's column.
    If the table has multi-column primary key, it raises an exception
    as this is currently not supported.
    """
    pkey_column_name = None
    for row in cursor.execute(f"pragma table_info('{table_name}')"):  # It doesn't have to be escaped
        if row[5]:
            if pkey_column_name is None:
                pkey_column_name = row[1]
            else:
                raise ValueError(f"table {table_name} has multi-column primary key")
    return pkey_column_name