With SQLAlchemy it is possible to create a constraint on two or more columns using the UniqueConstraint declaration. What would be the most idiomatic way of doing that using SQLModel? For example: from sqlmodel import SQLModel, Field class SubAccount(SQLModel): id: int = Field(primary_key=True) name: str description: str user_id: int = Field(foreign_key="user.id") How can I enforce that name should be unique for a given user_id ? Continue reading...