execute_statement
async
¶
execute_statement(
statement: PartiQLStatement,
*,
config_overrides: Optional[AsyncDynamoDBClientConfig] = None,
parameters: Optional[PreparedStatementParameters] = None,
consistent_read: Optional[ConsistentRead] = None,
next_token: Optional[PartiQLNextToken] = None,
return_consumed_capacity: Optional[ReturnConsumedCapacity] = None,
limit: Optional[PositiveIntegerObject] = None,
return_values_on_condition_check_failure: Optional[
ReturnValuesOnConditionCheckFailure
] = None,
) -> ExecuteStatementOutput
This operation allows you to perform reads and singleton writes on data stored in DynamoDB, using PartiQL.
For PartiQL reads (SELECT statement), if the total number of processed items exceeds the maximum dataset size limit of 1 MB, the read stops and results are returned to the user as a LastEvaluatedKey value to continue the read in a subsequent operation. If the filter criteria in WHERE clause does not match any data, the read will return an empty result set.
A single SELECT statement response can return up to the maximum number of items (if using the Limit parameter) or a maximum of 1 MB of data (and then apply any filtering to the results using WHERE clause). If LastEvaluatedKey is present in the response, you need to paginate the result set. If NextToken is present, you need to paginate the result set and include NextToken.
Parameters:
-
statement(PartiQLStatement) –The PartiQL statement representing the operation to run.
-
parameters(Optional[PreparedStatementParameters], default:None) –The parameters for the PartiQL statement, if any.
-
consistent_read(Optional[ConsistentRead], default:None) –The consistency of a read operation. If set to
true, then a strongly consistent read is used; otherwise, an eventually consistent read is used. -
next_token(Optional[PartiQLNextToken], default:None) –Set this value to get remaining results, if
NextTokenwas returned in the statement response. -
limit(Optional[PositiveIntegerObject], default:None) –The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, along with a key in
LastEvaluatedKeyto apply in a subsequent operation so you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key inLastEvaluatedKeyto apply in a subsequent operation to continue the operation. -
return_values_on_condition_check_failure(Optional[ReturnValuesOnConditionCheckFailure], default:None) –An optional parameter that returns the item attributes for an
ExecuteStatementoperation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
Raises:
-
ConditionalCheckFailedException–A condition specified in the operation failed to be evaluated.
-
DuplicateItemException–There was an attempt to insert an item with the same primary key as an item that already exists in the DynamoDB table.
-
InternalServerError–An error occurred on the server side.
-
ItemCollectionSizeLimitExceededException–An item collection is too large. This exception is only returned for tables that have one or more local secondary indexes.
-
ProvisionedThroughputExceededException–The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception. The Amazon Web Services SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests and use exponential backoff. For more information, go to Error Retries and Exponential Backoff in the Amazon DynamoDB Developer Guide.
-
RequestLimitExceeded–Throughput exceeds the current throughput quota for your account. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception. Contact Amazon Web Services Support to request a quota increase.
-
ResourceNotFoundException–The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be
ACTIVE. -
ThrottlingException–The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the ThrottlingReason field in the returned exception.
-
TransactionConflictException–Operation was rejected because there is an ongoing transaction for the item.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_dynamodb/_services/async_dynamo_db.py
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 | |