Skip to content

Instantly share code, notes, and snippets.

@oharaandrew314
Last active March 30, 2022 02:20
Show Gist options
  • Select an option

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

Select an option

Save oharaandrew314/e71eae9225f9eb038b5331bcbcf883a3 to your computer and use it in GitHub Desktop.
dynamodb-v2-kotlin-cat
@DynamoDbBean
data class DynamoCat(
@get:DynamoDbPartitionKey var ownerId: Int? = null,
@get:DynamoDbSortKey
@get:DynamoDbSecondaryPartitionKey(indexNames = ["names"])
var name: String? = null,
var gender: String? = null,
var features: List<String> = emptyList()
)
val schema = TableSchema.fromBean(DynamoCat::class.java)
val table = DynamoDbEnhancedClient.create().table("cat", schema)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment