Description
Describe the feature
A common interface for DynamoDbTable
and DynamoDbIndex
defining the scan
and query
methods.
Use Case
I have some pipeline methods that build QueryConditional
s, execute them, and unpack the results. Sometimes these queries are aimed at the base table, and sometimes at GSIs, depending on the sorting criteria. Currently, the table and index interfaces share no common base interface, resulting in code duplication.
Proposed Solution
DynamoDbTable
's query and scan methods return PageIterable<T>
, which is a subtype of DynamoDbIndex
's return type of SdkIterable<Page<T>>
. A common interface DynamoDbQueryable<T>
could be extended by both the table and index interfaces with no impact to existing code.
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS Java SDK version used
2.20.50
JDK version used
openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10) OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
Operating System and version
Gentoo Linux