Constrain on model attribute of where clause when using select #751
Unanswered
Jijun-TANG
asked this question in
Questions
Replies: 1 comment
-
from sqlalcmey import func
statement = select(Hero).where(func.lower(Hero.name) == "deadpond") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
Hello, I want to use select and impose a constraint on one of the attributes of selected model (adapting to the types of selected model, which is possible in sql query language ) like below:
statement = select(Hero).where(Hero.name.lower() == "deadpond")
But it doesn't work.
Here is the error message:
All in all, the functionality I want to realize is to be able to impose string transformation on the attribute of Model.
And right now it can only be realized by sqlite3:
Operating System
Linux, Windows
Operating System Details
Linux Ubuntu 18.04, Windows 10
SQLModel Version
0.0.14
Python Version
3.11.5
Additional Context
I think it is a feature to be added. Thanks in advance for anyone who read and test my codes in the question!
Beta Was this translation helpful? Give feedback.
All reactions