p

zio

dynamodb

package dynamodb

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. dynamodb
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class AttrMap(map: Map[String, AttributeValue]) extends GeneratedFromAttributeValueAs with Product with Serializable
  2. sealed trait AttributeValue extends AnyRef
  3. sealed trait AttributeValueType extends AnyRef
  4. sealed trait BillingMode extends AnyRef
  5. sealed trait ConditionExpression[-From] extends Renderable
  6. sealed trait ConsistencyMode extends AnyRef
  7. sealed trait DatabaseError extends Exception
  8. type Decoder[+A] = (AttributeValue) ⇒ Either[String, A]
  9. trait DynamoDBExecutor extends AnyRef
  10. sealed trait DynamoDBQuery[-In, +Out] extends AnyRef
  11. type Encoder[A] = (A) ⇒ AttributeValue
  12. type FilterExpression[-From] = ConditionExpression[From]
  13. trait FromAttributeValue[+A] extends AnyRef
  14. final case class GlobalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType, provisionedThroughput: Option[ProvisionedThroughput] = None) extends Product with Serializable
  15. type Item = AttrMap
  16. sealed trait KeyConditionExpression extends Renderable
  17. final case class KeySchema extends Product with Serializable
  18. type LastEvaluatedKey = Option[PrimaryKey]
  19. final case class LocalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType) extends Product with Serializable
  20. sealed trait PartitionKeyExpression extends KeyConditionExpression
  21. type PkAndItem = (PrimaryKey, Item)
  22. type PrimaryKey = AttrMap
  23. sealed trait PrimitiveValueType extends AttributeValueType
  24. sealed trait ProjectionExpression[-From, +To] extends AnyRef
  25. trait ProjectionExpressionLowPriorityImplicits0 extends ProjectionExpressionLowPriorityImplicits1
  26. trait ProjectionExpressionLowPriorityImplicits1 extends AnyRef
  27. sealed trait ProjectionType extends AnyRef
  28. final case class ProvisionedThroughput(readCapacityUnit: Long, writeCapacityUnit: Long) extends Product with Serializable
  29. sealed trait ReturnConsumedCapacity extends AnyRef
  30. sealed trait ReturnItemCollectionMetrics extends AnyRef
  31. sealed trait ReturnValues extends AnyRef
  32. final case class SSESpecification(enable: Boolean = false, kmsMasterKeyId: Option[String] = None, sseType: SSEType) extends Product with Serializable
  33. sealed trait Select extends AnyRef
  34. sealed trait SortKeyExpression extends AnyRef
  35. type TableNameAndPK = (String, String)
  36. trait TestDynamoDBExecutor extends AnyRef

    A Fake implementation of DynamoDBExecutor.Service that currently has the very modest aspiration of providing bare minimum functionality to enable internal unit tests and to enable simple end to end examples that can serve as documentation.

    A Fake implementation of DynamoDBExecutor.Service that currently has the very modest aspiration of providing bare minimum functionality to enable internal unit tests and to enable simple end to end examples that can serve as documentation. Limited CRUD functionality is supported hence some features are currently not supported or have restrictions.

    • Supported
      • CRUD operations GetItem, PutItem, DeleteItem, BatchGetItem, BatchWriteItem
    • Limited support
      • Primary Keys - only the partition key can be specified and is only checked for equality
    • Not currently supported
      • Projections - all fields are returned for all queries
      • Expressions - these include KeyConditionExpression's, ConditionExpression's, ProjectionExpression's, UpdateExpression's
      • Create table, Delete table
      • UpdateItem - this is a more complex case as it uses an expression to specify the update
      • Indexes in ScanSome, ScanAll, QuerySome, QueryAll

    Usage: DynamoDBExecutor.test provides you the test DB instance in a ZLayer. Tables are created using the addTable method in the test controller service TestDynamoDBExecutor. You specify a table, a single primary and a var arg list of primary key/item pairs.

    testM("getItem") {
      for {
        _ <- TestDynamoDBExecutor.addTable("tableName1", primaryKeyFieldName = "k1", primaryKey1 -> item1, primaryKey1_2 -> item1_2)
        result  <- GetItem(key = primaryKey1, tableName = tableName1).execute
        expected = Some(item1)
      } yield assert(result)(equalTo(expected))
    }.provideLayer(DynamoDBExecutor.test)
  37. trait ToAttributeValue[A] extends AnyRef
  38. trait ToAttributeValueLowPriorityImplicits0 extends ToAttributeValueLowPriorityImplicits1
  39. trait ToAttributeValueLowPriorityImplicits1 extends AnyRef
  40. final case class UpdateExpression[-A](action: Action[A]) extends Renderable with Product with Serializable
  41. sealed trait Zippable[-A, -B] extends AnyRef
  42. trait ZippableLowPriority1 extends ZippableLowPriority2
  43. trait ZippableLowPriority2 extends ZippableLowPriority3
  44. trait ZippableLowPriority3 extends ZippableLowPriority4
  45. trait ZippableLowPriority4 extends AnyRef

Value Members

  1. val Item: AttrMap.type
  2. val PrimaryKey: AttrMap.type
  3. def batchReadFromStream[R, A, B](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int = 10)(pk: (A) ⇒ PrimaryKey)(implicit arg0: Schema[B]): ZStream[R with Has[DynamoDBExecutor] with Clock, Throwable, (A, B)]

    Reads stream using function pk to determine the primary key which is then used to create a BatchGetItem request.

    Reads stream using function pk to determine the primary key which is then used to create a BatchGetItem request. Stream is batched into groups of 100 items in a BatchGetItem and executed using the provided DynamoDBExecutor service

    R

    Environment

    A

    Input stream element type

    B

    implicit Schema[B]

    mPar

    Level of parallelism for the stream processing

    pk

    Function to determine the primary key

    returns

    stream of (A, B), or fails on first error to convert an item to A

  4. def batchReadItemFromStream[R, A](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int = 10)(pk: (A) ⇒ PrimaryKey): ZStream[R with Has[DynamoDBExecutor] with Clock, Throwable, (A, Item)]

    Reads stream using function pk to determine the primary key which is then used to create a BatchGetItem request.

    Reads stream using function pk to determine the primary key which is then used to create a BatchGetItem request. Stream is batched into groups of 100 items in a BatchGetItem and executed using the provided DynamoDBExecutor service

    R

    Environment

    mPar

    Level of parallelism for the stream processing

    pk

    Function to determine the primary key

    returns

    A stream of (A, Item)

  5. def batchWriteFromStream[R, A, In, B](stream: ZStream[R, Throwable, A], mPar: Int = 10)(f: (A) ⇒ DynamoDBQuery[In, B]): ZStream[Has[DynamoDBExecutor] with R with Clock, Throwable, B]

    Reads stream and uses function f for creating a BatchWrite request that is executes for side effects.

    Reads stream and uses function f for creating a BatchWrite request that is executes for side effects. Stream is batched into groups of 25 items in a BatchWriteItem and executed using the DynamoDBExecutor service provided in the environment.

    R

    Environment

    B

    Type of DynamoDBQuery returned by f

    mPar

    Level of parallelism for the stream processing

    f

    Function that takes an A and returns a PutItem or WriteItem

    returns

    A stream of results from the DynamoDBQuery write's

  6. object Annotations
  7. object AttrMap extends GeneratedAttrMapApplies with Serializable
  8. object AttributeValue
  9. object AttributeValueType
  10. object BillingMode
  11. object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  12. object ConditionExpression
  13. object ConsistencyMode
  14. object DatabaseError extends Serializable
  15. object DynamoDBExecutor
  16. object DynamoDBQuery
  17. object EitherUtil
  18. object ExpressionAttributeNames
  19. object FromAttributeValue
  20. object KeyConditionExpression
  21. object KeySchema extends Serializable
  22. object PartitionKeyExpression
  23. object ProjectionExpression extends ProjectionExpressionLowPriorityImplicits0
  24. object ProjectionType
  25. object ReturnConsumedCapacity
  26. object ReturnItemCollectionMetrics
  27. object ReturnValues
  28. object SSESpecification extends Serializable
  29. object Select
  30. object SortKeyExpression
  31. object TestDynamoDBExecutor
  32. object ToAttributeValue extends ToAttributeValueLowPriorityImplicits0
  33. object UpdateExpression extends Serializable
  34. object Zippable extends ZippableLowPriority1

Inherited from AnyRef

Inherited from Any

Ungrouped