def get_primary_key(entity):
    """
    Gets primary key column from entity
    :param entity: SqlAlchemy model
    :return: SqlAlchemy Column
    """
    for column in getattr(entity, "__table__").c:
        if column.primary_key:
            return column
    return None