Created
March 19, 2022 19:04
-
-
Save oharaandrew314/e89705ab2ac9cfd983d2138e2142bfdd to your computer and use it in GitHub Desktop.
dynamokt-sample
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
| // create a data class model, making sure to give it a partition key | |
| data class Cat( | |
| @DynamoKtPartitionKey val name: String, | |
| val lives: Int = 9, | |
| ) | |
| // use the new table schema provided by this module to init the table mapper | |
| val tableSchema = DataClassTableSchema(Cat::class) | |
| val cats = DynamoDbEnhancedClient.create().table("cats", tableScema) | |
| // use the table mapper however you want!! | |
| cats.createTable() | |
| cats.putItem(Cat("Toggles")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment