DynamoDBQuery

zio.dynamodb.DynamoDBQuery
See theDynamoDBQuery companion trait
object DynamoDBQuery

Attributes

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

Members list

Type members

Classlikes

sealed trait Constructor[-In, +A] extends DynamoDBQuery[In, A]

Attributes

Supertypes
trait DynamoDBQuery[In, A]
class Object
trait Matchable
class Any
Known subtypes
trait Write[In, A]
final case class DescribeTableResponse(tableArn: String, tableStatus: TableStatus, tableSizeBytes: Long, itemCount: Long)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ScanAll

Attributes

Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ScanAll.type
object TableStatus

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait TableStatus

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Active
object Archived
object Archiving
object Creating
object Deleting
object Updating
Show all
sealed trait Write[-In, +A] extends Constructor[In, A]

Attributes

Supertypes
trait Constructor[In, A]
trait DynamoDBQuery[In, A]
class Object
trait Matchable
class Any

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply[A](a: => A): DynamoDBQuery[Any, A]
def conditionCheck(tableName: String, primaryKey: PrimaryKey)(conditionExpression: ConditionExpression[_]): ConditionCheck
def createTable(tableName: String, keySchema: KeySchema, billingMode: BillingMode, sseSpecification: Option[SSESpecification], tags: Map[String, String])(attributeDefinition: AttributeDefinition, attributeDefinitions: AttributeDefinition*): CreateTable
def deleteFrom[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From]): DynamoDBQuery[Any, Option[From]]
def deleteItem(tableName: String, key: PrimaryKey): Write[Any, Option[Item]]
def deleteTable(tableName: String): DeleteTable
def describeTable(tableName: String): DescribeTable
def fail(e: => DynamoDBError): DynamoDBQuery[Any, Nothing]
def forEach[In, A, B](values: Iterable[A])(body: A => DynamoDBQuery[In, B]): DynamoDBQuery[In, List[B]]

Each element in values is zipped together using function body which has signature A => DynamoDBQuery[B] Note that when DynamoDBQuery's are zipped together, on execution the queries are batched together as AWS DynamoDB batch queries whenever this is possible - only AWS GetItem, PutItem and DeleteItem queries can be batched, other query types will be executed in parallel.

Each element in values is zipped together using function body which has signature A => DynamoDBQuery[B] Note that when DynamoDBQuery's are zipped together, on execution the queries are batched together as AWS DynamoDB batch queries whenever this is possible - only AWS GetItem, PutItem and DeleteItem queries can be batched, other query types will be executed in parallel.

Note this is a low level function for a small amount of elements - if you want to perform a large number of reads and writes prefer the following utility functions - zio.dynamodb.batchReadItemFromStream, zio.dynamodb.batchWriteFromStream which work with ZStreams and efficiently limit batch sizes to the maximum size allowed by the AWS API, or alternatively use forEach to implement your own streaming functions.

Note that if you need need access to unprocessedItems or unprocessedKeys then an error handler for DynamoDBError.BatchError should be provided.

Attributes

def fromEither[A](or: Either[ItemError, A]): DynamoDBQuery[Any, A]
def get[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From]): DynamoDBQuery[From, Either[ItemError, From]]
def getItem(tableName: String, key: PrimaryKey, projections: ProjectionExpression[_, _]*): DynamoDBQuery[Any, Option[Item]]
def getWithNarrow[From : Enum, To <: From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[To]): DynamoDBQuery[From, Either[ItemError, To]]

Sometimes we want to save top level sum types to DynamoDB and we want to retrieve them back as the subtype with expressions in terms of the subtype as well. getWithNarrow does a get with a safe narrow operation from type From to To. If the narrow fails it returns a Decoding error with details of the cast failure in the message.

Sometimes we want to save top level sum types to DynamoDB and we want to retrieve them back as the subtype with expressions in terms of the subtype as well. getWithNarrow does a get with a safe narrow operation from type From to To. If the narrow fails it returns a Decoding error with details of the cast failure in the message.

Requires implicit schemas in scope which ensure that From is an enum (sealed trait) and To is a subtype.

Note this is an experimental API and may be subject to change.

Attributes

def put[A : Schema](tableName: String, a: A): DynamoDBQuery[A, Option[A]]
def putItem(tableName: String, item: Item): DynamoDBQuery[Any, Option[Item]]
def putWithNarrow[From : Enum, To <: From : Schema](tableName: String, a: To): DynamoDBQuery[To, Option[To]]

It is common to save the top level sum type to DynamoDB and often we want to save them back as the subtype with expressions in terms of the subtype as well. putWithNarrow does a put of type To which is widened to type From before the save to ensure that the discriminator is saved, and narrows the returned DynamoDBQuery to To .

It is common to save the top level sum type to DynamoDB and often we want to save them back as the subtype with expressions in terms of the subtype as well. putWithNarrow does a put of type To which is widened to type From before the save to ensure that the discriminator is saved, and narrows the returned DynamoDBQuery to To .

Requires implicit schemas in scope which ensure that From is an enum (sealed trait) and To is a subtype.

Note this is an experimental API and may be subject to change.

Attributes

def queryAll[A : Schema](tableName: String): DynamoDBQuery[A, Stream[Throwable, A]]

when executed will return a ZStream of A

when executed will return a ZStream of A

Attributes

def queryAllItem(tableName: String, projections: ProjectionExpression[_, _]*): QueryAll

when executed will return a ZStream of Item

when executed will return a ZStream of Item

Attributes

def querySome[A : Schema](tableName: String, limit: Int): DynamoDBQuery[A, (Chunk[A], LastEvaluatedKey)]

when executed will return a Tuple of

when executed will return a Tuple of

Either[String,(Chunk[A], LastEvaluatedKey)]

Attributes

def querySomeItem(tableName: String, limit: Int, projections: ProjectionExpression[_, _]*): QuerySome

when executed will return a Tuple of

when executed will return a Tuple of

(Chunk[Item], LastEvaluatedKey)

Attributes

def scanAll[A : Schema](tableName: String): DynamoDBQuery[A, Stream[Throwable, A]]

when executed will return a ZStream of A

when executed will return a ZStream of A

Attributes

def scanAllItem(tableName: String, projections: ProjectionExpression[_, _]*): ScanAll

when executed will return a ZStream of Item

when executed will return a ZStream of Item

Attributes

def scanSome[A : Schema](tableName: String, limit: Int): DynamoDBQuery[A, (Chunk[A], LastEvaluatedKey)]

when executed will return a Tuple of

when executed will return a Tuple of

Either[String,(Chunk[A], LastEvaluatedKey)]

Attributes

def scanSomeItem(tableName: String, limit: Int, projections: ProjectionExpression[_, _]*): ScanSome

when executed will return a Tuple of

when executed will return a Tuple of

(Chunk[Item], LastEvaluatedKey)

Attributes

def succeed[A](a: => A): DynamoDBQuery[Any, A]
def update[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From])(action: Action[From]): DynamoDBQuery[From, Option[From]]
def updateItem[A](tableName: String, key: PrimaryKey)(action: Action[A]): DynamoDBQuery[A, Option[Item]]