Asked By – bodacydo
Could anyone explain the difference between
filter_by functions in SQLAlchemy?
Which one should I be using?
Now we will see solution for issue: Difference between filter and filter_by in SQLAlchemy
filter_by is used for simple queries on the column names using regular kwargs, like
The same can be accomplished with
filter, not using kwargs, but instead using the ‘==’ equality operator, which has been overloaded on the db.users.name object:
You can also write more powerful queries using
filter, such as expressions like: