Execute the operations built with org.scanamo.Table, using the client provided synchronously
Execute the operations built with org.scanamo.Table, using the client provided synchronously
>>> import org.scanamo.auto._ >>> case class Transport(mode: String, line: String) >>> val transport = Table[Transport]("transport") >>> val client = LocalDynamoDB.client() >>> import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._ >>> LocalDynamoDB.withTable(client)("transport")('mode -> S, 'line -> S) { ... import org.scanamo.syntax._ ... val operations = for { ... _ <- transport.putAll(Set( ... Transport("Underground", "Circle"), ... Transport("Underground", "Metropolitan"), ... Transport("Underground", "Central"))) ... results <- transport.query('mode -> "Underground" and ('line beginsWith "C")) ... } yield results.toList ... Scanamo.exec(client)(operations) ... } List(Right(Transport(Underground,Central)), Right(Transport(Underground,Circle)))
Provides a simplified interface for reading and writing case classes to DynamoDB
To avoid blocking, use org.scanamo.ScanamoAsync