sqlmodel:如何使用自定义表名
在你的 SQLModel 子类中设置 __tablename__ 来定义自定义表名。
sqlmodel_custom_tablename.py
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"If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow