import org.scanamo.semiauto._
import org.scanamo.syntax._
Instant
in it
Instant
and it still doesn't like it
sealed trait Thing
case class Foo(a: Int, b: String) extends Thing
case class Bar(a: Long, b: String, c: Int) extends Thing
val thingTable: Table[Thing] = Table[Thing]("thing_table")(deriveDynamoFormat[Thing])
genericProduct | genericCoProduct
could not find implicit value for parameter gen: shapeless.LabelledGeneric.Aux[T,R]
add
in an update
, but as far as I can tell, add
adds a field, rather than incrementing its value. Am I missing something?
val query = secondaryIndex .query('org -> org.name and 'timestamp >= startTimeMs)
which is fine butval query = secondaryIndex .query('org -> org.name and 'timestamp >= startTimeMs and 'timestamp <= endTimeMs)
isn't compile.between
but that neither succeeded.Is this group still active? I'm trying to derive DynamoFormat for io.estatico.newtype.
import io.estatico.newtype.ops._
implicit def coercibleDecoder[A:Coercible[B, *],B]: DynamoFormat[A] =
DynamoFormat.coercedXmap[A, B, IllegalArgumentException](_.coerce[A])(
_.repr.asInstanceOf[B]
)
But I get
Error:(107, 78) could not find implicit value for evidence parameter of type org.scanamo.DynamoFormat[B]
DynamoFormat.coercedXmap[A, B, IllegalArgumentException](_.coerce[A])(
Can anyone help?
INCLUDE
, so I have only couple of fields in the index in comparison to the table itself. During query I have InvalidPropertiesError
. Is that a way to query GSI with projection in scanamo?
Hello, we're intending to use Dynamo to track basic usage statistics for some events. In our current table layout, we'd have a composite key and then a dynamic set of attributes with number values. e.g.
PK | sortKey | dynamicAttr1 | dynamicAttr2 | ..
----
1 | 2020-05-28 | 7 | 4 | ...
1 | 2020-05-29 | 12 | null | ...
2 | 2020-05-29 | null | 3 | ...
...
The above is easily done with the add
UpdateExpression and generating a Symbol
. However, is there an easy way to deserialize the items back out when doing a GET / Scan? Ideally, into something like a Map[String, Long] or Seq[(String, Long)]
Is there an easy way to get a non materialized list for a query
?
Something like
def iterateAll(query: Query[_]): ScanamoOps[Iterator[Either[DynamoReadError, V]]]
I would not mind creating my own wrapper using .from
and .limit
as a paging mechanism, but the lastEvaluatedKey
is not accessible and therefore I cannot use it in the next .from
val toLazyList: Id ~> LazyList = new (Id ~> LazyList) {
def apply[A](fa: Id[A]): LazyList[A] = LazyList(fa)
}
val op = si.queryPaginatedM[LazyList](query, pageSize = 10000)
scanamo.execT(toLazyList)(op).flatten // LazyList[Either[DynamoReadError, V]]
scanamoClient.exec(table.`given`("amountLeft" >= amountToTake).update(e, add("amountLeft" -> -amountToTake)))