A DynamoArray
is a pure representation of an array of AttributeValue
s
Type class for defining serialisation to and from
DynamoDB's AttributeValue
A DynamoObject
is a map of strings to values that can be embedded into
an AttributeValue
.
A DynamoValue
is a pure representation of an AttributeValue
from the AWS SDK.
prop> sealed trait Animal prop> case object Aardvark extends Animal prop> case object Hippopotamus extends Animal prop> case object Zebra extends Animal prop> import org.scalacheck._ prop> implicit val arbitraryAnimal: Arbitrary[Animal] = Arbitrary(Gen.oneOf(List(Aardvark, Hippopotamus, Zebra))) prop> (a: Animal) => | DynamoFormat[Animal].read(DynamoFormat[Animal].write(a)) == Right(a)
>>> DynamoFormat[Animal].write(Zebra).asString
Some(Zebra)
Fully automatic format derivation.
Fully automatic format derivation.
Importing the contents of this package object provides org.scanamo.DynamoFormat instances for case classes (if all members have instances)
Semi-automatic format derivation.
Semi-automatic format derivation.
This object provides helpers for creating org.scanamo.DynamoFormat instances for case classes
Typical usage will look like the following:
import org.scanamo.semiauto._ case class Bear(name: String, favouriteFood: String) object Bear { implicit val formatBear: DynamoFormat[Bear] = deriveDynamoFormat[Bear] }
Type class for defining serialisation to and from DynamoDB's
AttributeValue
and for sealed trait + case object hierarchies
Problems reading a value are detailed
Custom formats can often be most easily defined using DynamoFormat.coercedXmap, DynamoFormat.xmap or DynamoFormat.iso