mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-08-15 10:11:34 +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)
|
||||
money: condecimal(max_digits=5, decimal_places=3) = Field(default=0)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user