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

Need types for the paginator start token #1882

Closed
AllanZhengYP opened this issue Jan 7, 2021 · 4 comments
Closed

Need types for the paginator start token #1882

AllanZhengYP opened this issue Jan 7, 2021 · 4 comments
Labels
closed-for-staleness feature-request New feature or enhancement. May require GitHub community feedback.

Comments

@AllanZhengYP
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently the paginators start token is any type. It can be more specific to individual paginators. For example in paginateScan()'s start token is the type of ExclusiveStartKey. We can use generic to make the pagiator configuration interface include the start token type.

Without this type, users will be confused if they have an existing ExclusiveStartKey, where should they use. Take #1864 (comment) for example.

Describe the solution you'd like
PaginationConfiguration interface can contain a generic like:

export interface PaginationConfiguration<StartToken> {
  client: Client<any, any, any>;
  pageSize?: number;
  startingToken?: StartToken;
}

In individual paginator, the function signature can be:

export interface DynamoDBPaginationConfiguration<StartToken> extends PaginationConfiguration<StartToken> {
  client: DynamoDB | DynamoDBClient;
}
export async function* paginateScan(
  config: DynamoDBPaginationConfiguration<ExclusiveStartKey>,
  input: ScanCommandInput,
  ...additionalArguments: any
): Paginator<ScanCommandOutput>

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

/cc @alexforsyth

@AllanZhengYP AllanZhengYP added the feature-request New feature or enhancement. May require GitHub community feedback. label Jan 7, 2021
@alexforsyth
Copy link
Contributor

+1

@github-actions
Copy link

github-actions bot commented Jan 9, 2022

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jan 9, 2022
@trivikr trivikr removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jan 10, 2022
@github-actions
Copy link

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jan 11, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-for-staleness feature-request New feature or enhancement. May require GitHub community feedback.
Projects
None yet
Development

No branches or pull requests

3 participants