Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

CreateTableOptions not properly typed #198

Open
tsheaff opened this issue Oct 22, 2020 · 0 comments
Open

CreateTableOptions not properly typed #198

tsheaff opened this issue Oct 22, 2020 · 0 comments

Comments

@tsheaff
Copy link

tsheaff commented Oct 22, 2020

I see that this PR: https://github.com/awslabs/dynamodb-data-mapper-js/pull/147/files added support for SSE.

However, there seems do be some odd typing going on. When I read the source, I see that the type for options passed into createTable is CreateTableOptions, which extends BaseCreateTableOptions and includes:

export interface SseSpecification {
    sseType: SseType;
    kmsMasterKeyId?: string;
}

However, when I call createTable this in my code and click through to the type, I'm seeing a different CreateTableOptions type, which only extends ProvisionedThroughput and doesn't include sse options.

The same is true for billingMode.

Here are the types by comparison:

export type CreateTableOptions = ProvisionedCreateTableOptions | OnDemandCreateTableOptions;
export interface CreateTableOptions extends ProvisionedThroughput {
    streamViewType?: StreamViewType;
    indexOptions?: PerIndexOptions;
}

Why is there this odd discrepancy? It leads to a compiler error when calling createTable() with sseSpecification param. cc @jeskew

@tsheaff tsheaff changed the title sseSpecification options not properly typed CreateTableOptions not properly typed Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant