sqlmodel: How to use custom table name
Set __tablename__
in your SQLModel
subclass to define a custom table name.
class Product(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
mpn: Optional[str] = Field(description="Manufacturer part number", index=True)
__tablename__ = "MyApplicationProduct"