-
First Check
Commit to Help
Example Codeclass TOrder(SQLModel, table=True):
user: str
is_common: bool
__table_args__ = (
Index('ix_user_common', 'user', postgresql_where=(is_common.is_(True)))
) Description
Operating SystemmacOS Operating System DetailsNo response SQLModel Version0.0.24 Python VersionPython 3.12.10 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Answered by
yihuang
Jun 23, 2025
Replies: 1 comment
-
class TOrder(SQLModel, table=True):
user: str
is_common: bool = Field(sa_column=Boolean)
__table_args__ = (
Index('ix_user_common', 'user', postgresql_where=(is_common.sa_column.is_(True)))
) this works |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yihuang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this works