← ZIO Dynamodb docs

DynamoDBQuery

zio.dynamodb.DynamoDBQuery
See theDynamoDBQuery companion trait
object DynamoDBQuery

Attributes

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

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

Source
DynamoDBQuery.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ScanAll

Attributes

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

Attributes

Companion
trait
Source
DynamoDBQuery.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait TableStatus

Attributes

Companion
object
Source
DynamoDBQuery.scala
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

Source
DynamoDBQuery.scala
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
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apply[A](a: => A): DynamoDBQuery[Any, A]

Attributes

Source
DynamoDBQuery.scala
def batch[In, A, B](values: Iterable[A])(body: A => DynamoDBQuery[In, B]): DynamoDBQuery[In, Chunk[B]]

Primary entry point for batching queries together. The function body is called for each A in the list and the results are zipped together using a strict version of the zip operation. When the execute method on query is invoked a DynamoDBError.BatchError.UnbatchableQueryError is returned with an explanation if the query does not qualify for batching. For a full explanation of the batching rules please see https://zio.dev/zio-dynamodb/reference/auto-batching-and-parallelisation

Primary entry point for batching queries together. The function body is called for each A in the list and the results are zipped together using a strict version of the zip operation. When the execute method on query is invoked a DynamoDBError.BatchError.UnbatchableQueryError is returned with an explanation if the query does not qualify for batching. For a full explanation of the batching rules please see https://zio.dev/zio-dynamodb/reference/auto-batching-and-parallelisation

Note this is a low level function for a small amount of elements that is bounded by limits by the AWS API - 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 in a finite memory space and efficiently limit batch sizes to the maximum size allowed by the AWS API, or alternatively use batch 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

Source
DynamoDBQuery.scala
def conditionCheck(tableName: String, primaryKey: PrimaryKey)(conditionExpression: ConditionExpression[_]): ConditionCheck

Attributes

Source
DynamoDBQuery.scala
def createTable(tableName: String, keySchema: KeySchema, billingMode: BillingMode, sseSpecification: Option[SSESpecification] = ..., tags: Map[String, String] = ...)(attributeDefinition: AttributeDefinition, attributeDefinitions: AttributeDefinition*): CreateTable

Attributes

Source
DynamoDBQuery.scala
def deleteFrom[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From]): DynamoDBQuery[Any, Option[From]]

Attributes

Source
DynamoDBQuery.scala
def deleteItem(tableName: String, key: PrimaryKey): Write[Any, Option[Item]]

Attributes

Source
DynamoDBQuery.scala
def deleteTable(tableName: String): DeleteTable

Attributes

Source
DynamoDBQuery.scala
def describeTable(tableName: String): DescribeTable

Attributes

Source
DynamoDBQuery.scala
def fail(e: => DynamoDBError): DynamoDBQuery[Any, Nothing]

Attributes

Source
DynamoDBQuery.scala
def fromEither[A](or: Either[ItemError, A]): DynamoDBQuery[Any, A]

Attributes

Source
DynamoDBQuery.scala
def get[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From]): DynamoDBQuery[From, Either[ItemError, From]]

Attributes

Source
DynamoDBQuery.scala
def getItem(tableName: String, key: PrimaryKey, projections: ProjectionExpression[_, _]*): DynamoDBQuery[Any, Option[Item]]

Attributes

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

Source
DynamoDBQuery.scala
def put[A : Schema](tableName: String, a: A): DynamoDBQuery[A, Option[A]]

Attributes

Source
DynamoDBQuery.scala
def putItem(tableName: String, item: Item): DynamoDBQuery[Any, Option[Item]]

Attributes

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

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

Source
DynamoDBQuery.scala
def queryAllItem(tableName: String, projections: ProjectionExpression[_, _]*): QueryAll

when executed will return a ZStream of Item

when executed will return a ZStream of Item

Attributes

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

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

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

Source
DynamoDBQuery.scala
def scanAllItem(tableName: String, projections: ProjectionExpression[_, _]*): ScanAll

when executed will return a ZStream of Item

when executed will return a ZStream of Item

Attributes

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

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

Source
DynamoDBQuery.scala
def succeed[A](a: => A): DynamoDBQuery[Any, A]

Attributes

Source
DynamoDBQuery.scala
def update[From : Schema](tableName: String)(primaryKeyExpr: PrimaryKeyExpr[From])(action: Action[From]): DynamoDBQuery[From, Option[From]]

Attributes

Source
DynamoDBQuery.scala
def updateItem[A](tableName: String, key: PrimaryKey)(action: Action[A]): DynamoDBQuery[A, Option[Item]]

Attributes

Source
DynamoDBQuery.scala

Deprecated methods

def forEach[In, A, B](values: Iterable[A])(body: A => DynamoDBQuery[In, B]): DynamoDBQuery[In, List[B]]

Primary entry point for batching queries together. The function body is called for each A in the list and the results are zipped together using a strict version of the zip operation. When the execute method on query is invoked a DynamoDBError.BatchError.UnbatchableQueryError is returned with an explanation if the query does not qualify for batching. For a full explanation of the batching rules please see https://zio.dev/zio-dynamodb/reference/auto-batching-and-parallelisation

Primary entry point for batching queries together. The function body is called for each A in the list and the results are zipped together using a strict version of the zip operation. When the execute method on query is invoked a DynamoDBError.BatchError.UnbatchableQueryError is returned with an explanation if the query does not qualify for batching. For a full explanation of the batching rules please see https://zio.dev/zio-dynamodb/reference/auto-batching-and-parallelisation

Note this is a low level function for a small amount of elements that is bounded by limits by the AWS API - 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 in a finite memory space and efficiently limit batch sizes to the maximum size allowed by the AWS API, or alternatively use batch 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

Deprecated
[Since version ] Use batch instead
Source
DynamoDBQuery.scala