zio.dynamodb

package zio.dynamodb

Members list

Concise view

Type members

Classlikes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final case class AttrMap(map: Map[String, AttributeValue])

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
object AttrMap

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
AttrMap.type

Attributes

Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait AttributeValue

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait AttributeValueType

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object BinarySet.type
object Bool.type
object List.type
object Map.type
object Null.type
object NumberSet.type
object StringSet.type
object Binary.type
object Number.type
object String.type
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait BillingMode

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object PayPerRequest.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
sealed trait ConditionExpression[-From]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ConsistencyMode

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Strong.type
object Weak.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait DatabaseError extends Exception

Attributes

Companion:
object
Graph
Supertypes
class Exception
class Throwable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait DynamoDBError extends Exception with NoStackTrace

Attributes

Companion:
object
Graph
Supertypes
class Exception
class Throwable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
sealed trait DynamoDBQuery[-In, +Out]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Constructor[In, A]
trait Write[In, A]
Self type
DynamoDBQuery[In, Out]

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final case class GlobalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType, provisionedThroughput: Option[ProvisionedThroughput])

Attributes

Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class KeySchema

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
object KeySchema

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class LocalSecondaryIndex(indexName: String, keySchema: KeySchema, projection: ProjectionType)

Attributes

Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Equals
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Binary.type
object Number.type
object String.type
Self type
sealed trait ProjectionExpression[-From, +To]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait ProjectionType

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object All.type
object KeysOnly.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ProvisionedThroughput(readCapacityUnit: Long, writeCapacityUnit: Long)

Attributes

Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Indexes.type
object None.type
object Total.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object None.type
object Size.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ReturnValues

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AllNew.type
object AllOld.type
object None.type
object UpdatedNew.type
object UpdatedOld.type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class SSESpecification(enable: Boolean, kmsMasterKeyId: Option[String], sseType: SSEType)

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Select

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AllAttributes.type
object Count.type
object SpecificAttributes.type
object Select

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Select.type
sealed trait SortKeyExpression

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

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.

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)

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ToAttributeValue.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final case class UpdateExpression[-A](action: Action[A])

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Zippable[-A, -B]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Zippable.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Value members

Concrete methods

def batchReadFromStream[R, A, B : Schema](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int)(pk: A => PrimaryKey): ZStream[R & DynamoDBExecutor, Throwable, Either[DecodingError, (A, Option[B])]]

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

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

Attributes

A

Input stream element type

B

implicit Schema[B] where B is the type of the element in the returned stream

R

Environment

mPar

Level of parallelism for the stream processing

pk

Function to determine the primary key

Returns:

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

def batchReadItemFromStream[R, A](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int)(pk: A => PrimaryKey): ZStream[R & DynamoDBExecutor, Throwable, (A, Option[Item])]

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

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

Attributes

R

Environment

mPar

Level of parallelism for the stream processing

pk

Function to determine the primary key

Returns:

A stream of (A, Option[Item])

def batchWriteFromStream[R, A, In, B](stream: ZStream[R, Throwable, A], mPar: Int)(f: A => DynamoDBQuery[In, B]): ZStream[DynamoDBExecutor & R, Throwable, B]

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.

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.

Attributes

B

Type of DynamoDBQuery returned by f

R

Environment

f

Function that takes an A and returns a PutItem or WriteItem

mPar

Level of parallelism for the stream processing

Returns:

A stream of results from the DynamoDBQuery write's

Concrete fields

val Item: AttrMap.type