Created
June 17, 2022 23:41
-
-
Save mxro/6b80d0e012a860b94219b95014275aa1 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
| export function UserEntity<Name extends string>( | |
| table: Table<Name, 'pk', 'sk'> | |
| ): Entity<User, UserKey, typeof table> { | |
| const e = new Entity<User, UserKey, typeof table>({ | |
| name: 'User', | |
| attributes: { | |
| pk: { partitionKey: true }, | |
| sk: { hidden: true, sortKey: true }, | |
| name: { type: 'string', required: true }, | |
| emailVerified: { type: 'boolean', required: true }, | |
| }, | |
| table, | |
| } as const); | |
| return e; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment