aws-dynamodb-scala icon indicating copy to clipboard operation
aws-dynamodb-scala copied to clipboard

Create table from object definition

Open takezoe opened this issue 9 years ago • 0 comments

In aws-dynamodb-scala, the object which corresponds to the dynamo table like below is required.

object Members extends DynamoTable {
  protected val table = "members"
  val id      = DynamoHashKey[Int]("id")
  val country = DynamoRangeKey[String]("country")
  val name    = DynamoAttribute[String]("name")
  val age     = DynamoAttribute[Int]("age")
  val company = DynamoAttribute[String]("company")
  object companyIndex extends DynamoTable.SecondaryIndex {
    val index   = "companyIndex"
    val country = DynamoHashKey[String]("country")
    val company = DynamoRangeKey[String]("company")
  }  
}

Is it possible to create table from the above definition?

takezoe avatar May 01 '16 16:05 takezoe