← ZIO Dynamodb docs

zio.dynamodb

package zio.dynamodb

Members list

Type members

Classlikes

final case class AttrMap(map: Map[String, AttributeValue])

Attributes

Companion
object
Source
AttrMap.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
object AttrMap

Attributes

Companion
class
Source
AttrMap.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
AttrMap.type
final case class AttributeDefinition

Attributes

Companion
object
Source
AttributeDefinition.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
AttributeDefinition.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait AttributeValue

Attributes

Companion
object
Source
AttributeValue.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Source
AttributeValue.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait AttributeValueType

Attributes

Companion
object
Source
AttributeValueType.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object BinarySet
object Bool
object List
object Map
object Null
object NumberSet
object StringSet
object Binary
object Number
object String
Show all
Self type

Attributes

Companion
trait
Source
AttributeValueType.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait BillingMode

Attributes

Companion
object
Source
BillingMode.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object PayPerRequest
object BillingMode

Attributes

Companion
trait
Source
BillingMode.scala
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

Source
BuildInfo.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
BuildInfo.type
sealed trait ConditionExpression[-From]

Attributes

Companion
object
Source
ConditionExpression.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Source
ConditionExpression.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ConsistencyMode

Attributes

Companion
object
Source
ConsistencyMode.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Strong
object Weak

Attributes

Companion
trait
Source
ConsistencyMode.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Source
DynamoDBError.scala
Supertypes
trait Product
trait Equals
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
object DynamoDBError

Attributes

Companion
trait
Source
DynamoDBError.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Source
DynamoDBExecutor.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
DynamoDBExecutor.scala
Supertypes
class Object
trait Matchable
class Any
Self type
case object DynamoDBExecutorImpl

Attributes

Source
DynamoDBExecutorImpl.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed trait DynamoDBQuery[-In, +Out]

Attributes

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

Attributes

Companion
trait
Source
DynamoDBQuery.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait FromAttributeValue[+A]

Attributes

Companion
object
Source
FromAttributeValue.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

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

Attributes

Source
GlobalSecondaryIndex.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait KeyConditionExpr[-From]

This sum type models:

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

Attributes

Companion
object
Source
KeyConditionExpr.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait PrimaryKeyExpr[From]
Self type

Attributes

Companion
trait
Source
KeyConditionExpr.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class KeySchema

Attributes

Companion
object
Source
KeySchema.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object KeySchema

Attributes

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

Attributes

Source
LocalSecondaryIndex.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait PrimitiveValueType extends AttributeValueType

Attributes

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

Attributes

Companion
object
Source
ProjectionExpression.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Source
ProjectionExpression.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Source
ProjectionExpression.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait ProjectionType

Attributes

Companion
object
Source
ProjectionType.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object All
class Include
object KeysOnly

Attributes

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

Attributes

Source
ProvisionedThroughput.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ReturnConsumedCapacity

Attributes

Companion
object
Source
ReturnConsumedCapacity.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Indexes
object None
object Total

Attributes

Companion
trait
Source
ReturnConsumedCapacity.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Source
ReturnItemCollectionMetrics.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object None
object Size

Attributes

Companion
trait
Source
ReturnItemCollectionMetrics.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ReturnValues

Attributes

Companion
object
Source
ReturnValues.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AllNew
object AllOld
object None
object UpdatedNew
object UpdatedOld
object ReturnValues

Attributes

Companion
trait
Source
ReturnValues.scala
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
Source
SSESpecification.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
SSESpecification.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Select

Attributes

Companion
object
Source
Select.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Select

Attributes

Companion
trait
Source
Select.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Select.type

A Fake in memory implementation of DynamoDBExecutor.Service that currently provides bare minimum functionality to enable High and Low level API unit tests and examples that can serve as documentation. Limited CRUD functionality is supported hence some features are currently not supported or have restrictions.

A Fake in memory implementation of DynamoDBExecutor.Service that currently provides bare minimum functionality to enable High and Low level API unit tests and 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
Source
TestDynamoDBExecutor.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
TestDynamoDBExecutor.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait ToAttributeValue[A]

Attributes

Companion
object
Source
ToAttributeValue.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
ToAttributeValue.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
ToAttributeValue.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

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

Attributes

Companion
object
Source
UpdateExpression.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Companion
class
Source
UpdateExpression.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Zippable[-A, -B]

Attributes

Companion
object
Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any
Show all
Self type
Zippable.type

Attributes

Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
object Zippable

Attributes

Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
Zippable.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object syntax

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Types

Attributes

Source
package.scala
type Encoder[A] = A => AttributeValue

Attributes

Source
package.scala

Attributes

Source
package.scala
type Item = AttrMap

Attributes

Source
package.scala

Attributes

Source
package.scala

Attributes

Source
package.scala

Value members

Concrete methods

def batchReadFromStream[R, A, From : Schema](tableName: String, stream: ZStream[R, Throwable, A], mPar: Int = ...)(pk: A => PrimaryKeyExpr[From]): ZStream[R & 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. 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

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

Type parameters

A

Input stream element type

From

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

R

Environment

Value parameters

mPar

Level of parallelism for the stream processing

pk

Function to determine the primary key

Attributes

Returns

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

Source
package.scala
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.

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

Type parameters

R

Environment

Value parameters

mPar

Level of parallelism for the stream processing

pk

Function to determine the primary key

Attributes

Returns

A stream of (A, Option[Item])

Source
package.scala
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.

Note that if function f returns a PutItem or DeleteItem that contains a ConditionExpression then the entire aggregated chunk of up to 25 items will not be batched! (this is a limitation of AWS BatchWriteItem) - instead they will be executed in parallel.

Type parameters

B

Type of DynamoDBQuery returned by f

R

Environment

Value parameters

f

Function that takes an A and returns a PutItem or DeleteItem

mPar

Level of parallelism for the stream processing

Attributes

Returns

A stream of results from the DynamoDBQuery write's

Source
package.scala

Concrete fields

val Item: AttrMap.type

Attributes

Source
package.scala
val PrimaryKey: AttrMap.type

Attributes

Source
package.scala