Created
June 17, 2022 23:41
-
-
Save mxro/7fa7d70ec07e981bb3c990fd25cd12bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Table, Entity } from 'dynamodb-toolbox'; | |
| export function createTable<Name extends string>( | |
| dynamoDB: DynamoDB.DocumentClient, | |
| tableName: string | |
| ): Table<Name, 'pk', 'sk'> { | |
| return new Table({ | |
| name: tableName, | |
| partitionKey: 'pk', | |
| sortKey: 'sk', | |
| DocumentClient: dynamoDB, | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment