Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Discussion options

You must be logged in to vote

This should work:

query = User.select().with_only_columns([User.c.email, User.c.id])

results = await database.fetch_all(query=query)

https://docs.sqlalchemy.org/en/14/core/selectable.html#sqlalchemy.sql.expression.Select.with_only_columns

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aminalaee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants