Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Select parameter to Model/Index.query/scan #969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ikonst
Copy link
Contributor

@ikonst ikonst commented Aug 11, 2021

On top of the existing attributes_to_get, Scan.Select and Query.Select allows queries and scans against indexes with KEYS_ONLY and INCLUDE projections to read-through to the underlying table to fetch the entire model.

P.S. Effectively the interesting mode of operation here is just scan='ALL_ATTRIBUTES' for an index. Perhaps we shouldn't add it to Model.query/scan at all, while Index.query/scan should have ensure_all_attributes: bool which would trigger the behavior described here?

ALL_ATTRIBUTES - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.

@ikonst ikonst changed the title Allow passing Select to Model/Index.query/scan Add Select parameter to Model/Index.query/scan Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant