-
What is the alternative for this query while using this library? query = User.query
query.with_entities(User.email, User.id).all() |
Beta Was this translation helpful? Give feedback.
Answered by
aminalaee
Sep 21, 2021
Replies: 1 comment
-
This should work: query = User.select().with_only_columns([User.c.email, User.c.id])
results = await database.fetch_all(query=query) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aminalaee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should work:
https://docs.sqlalchemy.org/en/14/core/selectable.html#sqlalchemy.sql.expression.Select.with_only_columns