aws / aws/aws-sdk-java-v2

Common DynamoDb Enhanced interface for "queryable"

Open
#3,943 1 comment 0 reactions 0 assignees View on GitHub
dynamodb-enhanced feature-request p3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

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`, which is a subtype of `DynamoDbIndex`'s return type of `SdkIterable>`. A common interface `DynamoDbQueryable` could be extended by both the table and index interfaces with no impact to existing code.

### Other Information

_No response_

### Acknowledgements

- [X] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.