Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
Synopsis
- data ExecuteStatement = ExecuteStatement' {}
- newExecuteStatement :: Text -> ExecuteStatement
- executeStatement_consistentRead :: Lens' ExecuteStatement (Maybe Bool)
- executeStatement_limit :: Lens' ExecuteStatement (Maybe Natural)
- executeStatement_nextToken :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_parameters :: Lens' ExecuteStatement (Maybe (NonEmpty AttributeValue))
- executeStatement_returnConsumedCapacity :: Lens' ExecuteStatement (Maybe ReturnConsumedCapacity)
- executeStatement_statement :: Lens' ExecuteStatement Text
- data ExecuteStatementResponse = ExecuteStatementResponse' {}
- newExecuteStatementResponse :: Int -> ExecuteStatementResponse
- executeStatementResponse_consumedCapacity :: Lens' ExecuteStatementResponse (Maybe ConsumedCapacity)
- executeStatementResponse_items :: Lens' ExecuteStatementResponse (Maybe [HashMap Text AttributeValue])
- executeStatementResponse_lastEvaluatedKey :: Lens' ExecuteStatementResponse (Maybe (HashMap Text AttributeValue))
- executeStatementResponse_nextToken :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int
Creating a Request
data ExecuteStatement Source #
See: newExecuteStatement
smart constructor.
ExecuteStatement' | |
|
Instances
Create a value of ExecuteStatement
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
ExecuteStatement
, executeStatement_consistentRead
- The consistency of a read operation. If set to true
, then a strongly
consistent read is used; otherwise, an eventually consistent read is
used.
$sel:limit:ExecuteStatement'
, executeStatement_limit
- 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
LastEvaluatedKey
to 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 in LastEvaluatedKey
to
apply in a subsequent operation to continue the operation.
ExecuteStatement
, executeStatement_nextToken
- Set this value to get remaining results, if NextToken
was returned in
the statement response.
ExecuteStatement
, executeStatement_parameters
- The parameters for the PartiQL statement, if any.
$sel:returnConsumedCapacity:ExecuteStatement'
, executeStatement_returnConsumedCapacity
- Undocumented member.
ExecuteStatement
, executeStatement_statement
- The PartiQL statement representing the operation to run.
Request Lenses
executeStatement_consistentRead :: Lens' ExecuteStatement (Maybe Bool) Source #
The consistency of a read operation. If set to true
, then a strongly
consistent read is used; otherwise, an eventually consistent read is
used.
executeStatement_limit :: Lens' ExecuteStatement (Maybe Natural) Source #
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
LastEvaluatedKey
to 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 in LastEvaluatedKey
to
apply in a subsequent operation to continue the operation.
executeStatement_nextToken :: Lens' ExecuteStatement (Maybe Text) Source #
Set this value to get remaining results, if NextToken
was returned in
the statement response.
executeStatement_parameters :: Lens' ExecuteStatement (Maybe (NonEmpty AttributeValue)) Source #
The parameters for the PartiQL statement, if any.
executeStatement_returnConsumedCapacity :: Lens' ExecuteStatement (Maybe ReturnConsumedCapacity) Source #
Undocumented member.
executeStatement_statement :: Lens' ExecuteStatement Text Source #
The PartiQL statement representing the operation to run.
Destructuring the Response
data ExecuteStatementResponse Source #
See: newExecuteStatementResponse
smart constructor.
ExecuteStatementResponse' | |
|
Instances
newExecuteStatementResponse Source #
Create a value of ExecuteStatementResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:consumedCapacity:ExecuteStatementResponse'
, executeStatementResponse_consumedCapacity
- Undocumented member.
$sel:items:ExecuteStatementResponse'
, executeStatementResponse_items
- If a read operation was used, this property will contain the result of
the read operation; a map of attribute names and their values. For the
write operations this value will be empty.
$sel:lastEvaluatedKey:ExecuteStatementResponse'
, executeStatementResponse_lastEvaluatedKey
- The primary key of the item where the operation stopped, inclusive of
the previous result set. Use this value to start a new operation,
excluding this value in the new request. If LastEvaluatedKey
is empty,
then the "last page" of results has been processed and there is no
more data to be retrieved. If LastEvaluatedKey
is not empty, it does
not necessarily mean that there is more data in the result set. The only
way to know when you have reached the end of the result set is when
LastEvaluatedKey
is empty.
ExecuteStatement
, executeStatementResponse_nextToken
- If the response of a read request exceeds the response payload limit
DynamoDB will set this value in the response. If set, you can use that
this value in the subsequent request to get the remaining results.
$sel:httpStatus:ExecuteStatementResponse'
, executeStatementResponse_httpStatus
- The response's http status code.
Response Lenses
executeStatementResponse_consumedCapacity :: Lens' ExecuteStatementResponse (Maybe ConsumedCapacity) Source #
Undocumented member.
executeStatementResponse_items :: Lens' ExecuteStatementResponse (Maybe [HashMap Text AttributeValue]) Source #
If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.
executeStatementResponse_lastEvaluatedKey :: Lens' ExecuteStatementResponse (Maybe (HashMap Text AttributeValue)) Source #
The primary key of the item where the operation stopped, inclusive of
the previous result set. Use this value to start a new operation,
excluding this value in the new request. If LastEvaluatedKey
is empty,
then the "last page" of results has been processed and there is no
more data to be retrieved. If LastEvaluatedKey
is not empty, it does
not necessarily mean that there is more data in the result set. The only
way to know when you have reached the end of the result set is when
LastEvaluatedKey
is empty.
executeStatementResponse_nextToken :: Lens' ExecuteStatementResponse (Maybe Text) Source #
If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.
executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int Source #
The response's http status code.