Skip to content

DynamoDB  >  Operations  >  execute_transaction

execute_transaction

Operation

execute_transaction async

execute_transaction(input: ExecuteTransactionInput, plugins: list[Plugin] | None = None) -> ExecuteTransactionOutput

This operation allows you to perform transactional reads or writes on data stored in DynamoDB, using PartiQL.

Note

The entire transaction must consist of either read statements or write statements, you cannot mix both in one transaction. The EXISTS function is an exception and can be used to check the condition of specific attributes of the item in a similar manner to ConditionCheck in the TransactWriteItems API.

Parameters:

Name Type Description Default
input ExecuteTransactionInput

An instance of ExecuteTransactionInput.

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
ExecuteTransactionOutput

An instance of ExecuteTransactionOutput.

Input

ExecuteTransactionInput dataclass

Dataclass for ExecuteTransactionInput structure.

Attributes

client_request_token class-attribute instance-attribute
client_request_token: str | None = None

Set this value to get remaining results, if NextToken was returned in the statement response.

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. For more information, see TransactGetItems and TransactWriteItems.

transact_statements class-attribute instance-attribute
transact_statements: list[ParameterizedStatement] | None = None

The list of PartiQL statements representing the transaction to run.

Output

ExecuteTransactionOutput dataclass

Dataclass for ExecuteTransactionOutput 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[ItemResponse] | None = None

The response to a PartiQL transaction.