def get_column_names(entity):
    """Returns an iterable of column names the entity has"""
    if hasattr(entity, '__pg_properties__'):
        return (k for k in entity.__pg_properties__)

    return (c.name for c in entity.__table__.columns)