execute_transaction¶
Operation¶
execute_transaction
¶
execute_transaction(request: ExecuteTransactionInput | ExecuteTransactionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ExecuteTransactionInputDict]) -> 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 |
|---|---|---|---|
request
|
ExecuteTransactionInput | ExecuteTransactionInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[ExecuteTransactionInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
ExecuteTransactionOutput
|
An instance of |
execute_transaction
async
¶
execute_transaction(request: ExecuteTransactionInput | ExecuteTransactionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ExecuteTransactionInputDict]) -> 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 |
|---|---|---|---|
request
|
ExecuteTransactionInput | ExecuteTransactionInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[ExecuteTransactionInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
ExecuteTransactionOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
ExecuteTransactionInputDict
¶
Bases: TypedDict
Dictionary form of ExecuteTransactionInput.
Attributes¶
client_request_token
instance-attribute
¶
client_request_token: str | None
Set this value to get remaining results, if NextToken was returned in
the statement response.
This field is autopopulated if not provided.
return_consumed_capacity
instance-attribute
¶
return_consumed_capacity: str | 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
instance-attribute
¶
transact_statements: Required[Sequence[ParameterizedStatement | ParameterizedStatementDict]]
The list of PartiQL statements representing the transaction to run.
ExecuteTransactionInput
dataclass
¶
Bases: _SerdeShape
Dataclass for ExecuteTransactionInput structure.
Attributes¶
client_request_token
class-attribute
instance-attribute
¶
client_request_token: str | None = ...
Set this value to get remaining results, if NextToken was returned in
the statement response.
This field is autopopulated if not provided.
return_consumed_capacity
class-attribute
instance-attribute
¶
return_consumed_capacity: str | 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 = ...
The list of PartiQL statements representing the transaction to run.
Output¶
ExecuteTransactionOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for ExecuteTransactionOutput structure.
Attributes¶
consumed_capacity
class-attribute
instance-attribute
¶
consumed_capacity: list[ConsumedCapacity] | None = ...
The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.
responses
class-attribute
instance-attribute
¶
responses: list[ItemResponse] | None = ...
The response to a PartiQL transaction.