Skip to content

DynamoDB  >  Operations  >  batch_execute_statement

batch_execute_statement

Operation

batch_execute_statement async

batch_execute_statement(input: BatchExecuteStatementInput, plugins: list[Plugin] | None = None) -> BatchExecuteStatementOutput

This operation allows you to perform batch reads or writes on data stored in DynamoDB, using PartiQL. Each read statement in a BatchExecuteStatement must specify an equality condition on all key attributes. This enforces that each SELECT statement in a batch returns at most a single item. For more information, see Running batch operations with PartiQL for DynamoDB .

Note

The entire batch must consist of either read statements or write statements, you cannot mix both in one batch.

Warning: A HTTP 200 response does not mean that all statements in the BatchExecuteStatement succeeded. Error details for individual statements can be found under the Error field of the BatchStatementResponse for each statement.

Parameters:

Name Type Description Default
input BatchExecuteStatementInput

An instance of BatchExecuteStatementInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
BatchExecuteStatementOutput

An instance of BatchExecuteStatementOutput.

Input

BatchExecuteStatementInput dataclass

Dataclass for BatchExecuteStatementInput structure.

Attributes

return_consumed_capacity class-attribute instance-attribute
return_consumed_capacity: ReturnConsumedCapacity | None = None

Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

  • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

  • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

  • NONE - No ConsumedCapacity details are included in the response.

statements class-attribute instance-attribute
statements: list[BatchStatementRequest] | None = None

The list of PartiQL statements representing the batch to run.

Output

BatchExecuteStatementOutput dataclass

Dataclass for BatchExecuteStatementOutput structure.

Attributes

consumed_capacity class-attribute instance-attribute
consumed_capacity: list[ConsumedCapacity] | None = None

The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.

responses class-attribute instance-attribute
responses: list[BatchStatementResponse] | None = None

The response to each PartiQL statement in the batch. The values of the list are ordered according to the ordering of the request statements.