p

zio

dynamodb

package dynamodb

Linear Supertypes
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[DynamoDBError, A]
  9. sealed trait DynamoDBError extends Exception with NoStackTrace
  10. trait DynamoDBExecutor extends AnyRef
  11. sealed trait DynamoDBQuery[-In, +Out] extends AnyRef
  12. type Encoder[A] = (A) ⇒ AttributeValue
  13. type FilterExpression[-From] = ConditionExpression[From]
  14. trait FromAttributeValue[+A] extends AnyRef
  15. final case class GlobalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType, provisionedThroughput: Option[ProvisionedThroughput] = None) extends Product with Serializable
  16. type Item = AttrMap
  17. sealed trait KeyConditionExpression extends Renderable
  18. final case class KeySchema extends Product with Serializable
  19. type LastEvaluatedKey = Option[PrimaryKey]
  20. final case class LocalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType) extends Product with Serializable
  21. sealed trait PartitionKeyExpression extends KeyConditionExpression
  22. type PkAndItem = (PrimaryKey, Item)
  23. type PrimaryKey = AttrMap
  24. sealed trait PrimitiveValueType extends AttributeValueType
  25. sealed trait ProjectionExpression[-From, +To] extends AnyRef
  26. trait ProjectionExpressionLowPriorityImplicits0 extends ProjectionExpressionLowPriorityImplicits1
  27. trait ProjectionExpressionLowPriorityImplicits1 extends AnyRef
  28. sealed trait ProjectionType extends AnyRef
  29. final case class ProvisionedThroughput(readCapacityUnit: Long, writeCapacityUnit: Long) extends Product with Serializable
  30. sealed trait ReturnConsumedCapacity extends AnyRef
  31. sealed trait ReturnItemCollectionMetrics extends AnyRef
  32. sealed trait ReturnValues extends AnyRef
  33. final case class SSESpecification(enable: Boolean = false, kmsMasterKeyId: Option[String] = None, sseType: SSEType) extends Product with Serializable
  34. sealed trait Select extends AnyRef
  35. sealed trait SortKeyExpression extends AnyRef
  36. type TableNameAndPK = (String, String)
  37. 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)
  38. trait ToAttributeValue[A] extends AnyRef
  39. trait ToAttributeValueLowPriorityImplicits0 extends ToAttributeValueLowPriorityImplicits1
  40. trait ToAttributeValueLowPriorityImplicits1 extends AnyRef
  41. final case class UpdateExpression[-A](action: Action[A]) extends Renderable with Product with Serializable
  42. sealed trait Zippable[-A, -B] extends AnyRef
  43. trait ZippableLowPriority1 extends ZippableLowPriority2
  44. trait ZippableLowPriority2 extends ZippableLowPriority3
  45. trait ZippableLowPriority3 extends ZippableLowPriority4
  46. 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 DynamoDBExecutor, 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 DynamoDBExecutor, 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[DynamoDBExecutor with R, 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 DynamoDBError extends Serializable
  16. object DynamoDBExecutor
  17. object DynamoDBQuery
  18. object EitherUtil
  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