Skip to content

Instantly share code, notes, and snippets.

@oharaandrew314
Created March 19, 2022 19:04
Show Gist options
  • Select an option

  • Save oharaandrew314/e89705ab2ac9cfd983d2138e2142bfdd to your computer and use it in GitHub Desktop.

Select an option

Save oharaandrew314/e89705ab2ac9cfd983d2138e2142bfdd to your computer and use it in GitHub Desktop.
dynamokt-sample
// 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