mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-11-02 04:06:49 +08:00
✨ Document indexes and make them opt-in (#205)
This commit is contained in:
committed by
GitHub
parent
3d7b74746c
commit
155c6178cd
@ -6,9 +6,9 @@ from sqlmodel import Field, Session, SQLModel, create_engine, select
|
||||
|
||||
class Hero(SQLModel, table=True):
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
name: str
|
||||
name: str = Field(index=True)
|
||||
secret_name: str
|
||||
age: Optional[int] = None
|
||||
age: Optional[int] = Field(default=None, index=True)
|
||||
|
||||
|
||||
class HeroCreate(SQLModel):
|
||||
|
||||
Reference in New Issue
Block a user