async def METHOD_NAME(
    cls,
    db: "AsyncSession",
    objects: List[Schema],
    constraints: List["InstrumentedAttribute[Any]"],
    autocommit: bool = True,
) -> List[Self]:
    if len(objects) == 0:
        raise ValueError("Cannot upsert empty list of objects")
    values = [obj.dict() for obj in objects]
    # Try to insert all objects
    insert_stmt = _INSERT_FUNC[db.bind.dialect.name](cls).values(values)
    # On conflict, update the columns that are upsertable (defined in `Model.__upsertable_columns__`)
    columns_to_update = {column: getattr(insert_stmt.excluded, column) for column in cls.__upsertable_columns__}
    # onupdate for `updated_at` is not working. We need to force a new value on update
    if hasattr(cls, "updated_at"):
        columns_to_update["updated_at"] = datetime.utcnow()
    upsert_stmt = (
        insert_stmt.on_conflict_do_update(index_elements=constraints, set_=columns_to_update)
        .returning(cls)
        .execution_options(populate_existing=True)
    )
    result = await db.execute(upsert_stmt)
    if autocommit:
        await db.commit()
    return result.scalars().all()