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. Protected

Package Members

  1. package proofs

Type Members

  1. final case class AttrMap(map: Map[String, AttributeValue]) extends GeneratedFromAttributeValueAs with Product with Serializable
  2. final case class AttributeDefinition extends Product with Serializable
  3. sealed trait AttributeValue extends AnyRef
  4. sealed trait AttributeValueType extends AnyRef
  5. sealed trait BillingMode extends AnyRef
  6. sealed trait ConditionExpression[-From] extends Renderable
  7. sealed trait ConsistencyMode extends AnyRef
  8. type Decoder[+A] = (AttributeValue) => Either[ItemError, A]
  9. sealed trait DynamoDBError extends Throwable with NoStackTrace with Product with Serializable
  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 KeyConditionExpr[-From] extends Renderable

    This sum type models: 1) partition key equality expressions 2) composite primary key expressions where sort key expression is equality 3) extended composite primary key expressions where sort key is not equality eg >, <, >=, <=, between, begins_with

    This sum type models: 1) partition key equality expressions 2) composite primary key expressions where sort key expression is equality 3) extended composite primary key expressions where sort key is not equality eg >, <, >=, <=, between, begins_with

    Note 1), 2) and 3) are all valid key condition expressions used in Query DynamoDB queries BUT only 1) and 2) are valid primary key expressions that can be used in GetItem, UpdateItem and DeleteItem DynamoDB queries

  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. 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. type TableNameAndPK = (String, String)
  35. 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)
  36. trait ToAttributeValue[A] extends AnyRef
  37. trait ToAttributeValueLowPriorityImplicits0 extends ToAttributeValueLowPriorityImplicits1
  38. trait ToAttributeValueLowPriorityImplicits1 extends AnyRef
  39. final case class UpdateExpression[-A](action: Action[A]) extends Renderable with Product with Serializable
  40. sealed trait Zippable[-A, -B] extends AnyRef
  41. trait ZippableLowPriority1 extends ZippableLowPriority2
  42. trait ZippableLowPriority2 extends ZippableLowPriority3
  43. trait ZippableLowPriority3 extends ZippableLowPriority4
  44. trait ZippableLowPriority4 extends AnyRef

Value Members

  1. val Item: AttrMap.type
  2. val PrimaryKey: AttrMap.type
  3. def batchReadFromStream[R, A, From](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int = 10)(pk: (A) => PrimaryKeyExpr[From])(implicit arg0: Schema[From]): ZStream[R with DynamoDBExecutor, Throwable, Either[DecodingError, (A, Option[From])]]

    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 Returns a tuple of (A, Option[B]) where the option is None if the item is not found - this enables "LEFT outer join" like functionality

    R

    Environment

    A

    Input stream element type

    mPar

    Level of parallelism for the stream processing

    pk

    Function to determine the primary key

    returns

    stream of Either[DynamoDBError.DecodingError, (A, Option[B])]

  4. def batchReadItemFromStream[R, A](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int = 10)(pk: (A) => PrimaryKey): ZStream[R with DynamoDBExecutor, Throwable, (A, Option[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, Option[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 AttrMap extends GeneratedAttrMapApplies with Serializable
  7. object AttributeDefinition extends Serializable
  8. object AttributeValue
  9. object AttributeValueType
  10. object BillingMode
  11. case object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  12. object ConditionExpression
  13. object ConsistencyMode
  14. object DynamoDBError extends Serializable
  15. object DynamoDBExecutor
  16. case object DynamoDBExecutorImpl extends Product with Serializable
  17. object DynamoDBQuery
  18. object FromAttributeValue
  19. object KeyConditionExpr
  20. object KeySchema extends Serializable
  21. object ProjectionExpression extends ProjectionExpressionLowPriorityImplicits0
  22. object ProjectionType
  23. object ReturnConsumedCapacity
  24. object ReturnItemCollectionMetrics
  25. object ReturnValues
  26. object SSESpecification extends Serializable
  27. object Select
  28. object TestDynamoDBExecutor
  29. object ToAttributeValue extends ToAttributeValueLowPriorityImplicits0
  30. object UpdateExpression extends Serializable
  31. object Zippable extends ZippableLowPriority1
  32. object syntax

Inherited from AnyRef

Inherited from Any

Ungrouped