amazonka-dynamodb-2.0: Amazon DynamoDB SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.DynamoDB.ExecuteStatement

Description

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

Creating a Request

data ExecuteStatement Source #

See: newExecuteStatement smart constructor.

Constructors

ExecuteStatement' 

Fields

  • consistentRead :: Maybe Bool

    The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

  • limit :: Maybe Natural

    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.

  • nextToken :: Maybe Text

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

  • parameters :: Maybe (NonEmpty AttributeValue)

    The parameters for the PartiQL statement, if any.

  • returnConsumedCapacity :: Maybe ReturnConsumedCapacity
     
  • statement :: Text

    The PartiQL statement representing the operation to run.

Instances

Instances details
ToJSON ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

ToHeaders ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

ToPath ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

ToQuery ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

AWSRequest ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Associated Types

type AWSResponse ExecuteStatement #

Generic ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Associated Types

type Rep ExecuteStatement :: Type -> Type #

Read ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Show ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

NFData ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Methods

rnf :: ExecuteStatement -> () #

Eq ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Hashable ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

type AWSResponse ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

type Rep ExecuteStatement Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

type Rep ExecuteStatement = D1 ('MetaData "ExecuteStatement" "Amazonka.DynamoDB.ExecuteStatement" "amazonka-dynamodb-2.0-GNxlseyeFiu302JKQwQrUS" 'False) (C1 ('MetaCons "ExecuteStatement'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "consistentRead") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "limit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty AttributeValue))) :*: (S1 ('MetaSel ('Just "returnConsumedCapacity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ReturnConsumedCapacity)) :*: S1 ('MetaSel ('Just "statement") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newExecuteStatement Source #

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_statement :: Lens' ExecuteStatement Text Source #

The PartiQL statement representing the operation to run.

Destructuring the Response

data ExecuteStatementResponse Source #

See: newExecuteStatementResponse smart constructor.

Constructors

ExecuteStatementResponse' 

Fields

  • consumedCapacity :: Maybe ConsumedCapacity
     
  • items :: Maybe [HashMap Text AttributeValue]

    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.

  • lastEvaluatedKey :: Maybe (HashMap Text AttributeValue)

    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.

  • nextToken :: Maybe Text

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Associated Types

type Rep ExecuteStatementResponse :: Type -> Type #

Read ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Show ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

NFData ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

Eq ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

type Rep ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.DynamoDB.ExecuteStatement

type Rep ExecuteStatementResponse = D1 ('MetaData "ExecuteStatementResponse" "Amazonka.DynamoDB.ExecuteStatement" "amazonka-dynamodb-2.0-GNxlseyeFiu302JKQwQrUS" 'False) (C1 ('MetaCons "ExecuteStatementResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "consumedCapacity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ConsumedCapacity)) :*: S1 ('MetaSel ('Just "items") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [HashMap Text AttributeValue]))) :*: (S1 ('MetaSel ('Just "lastEvaluatedKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text AttributeValue))) :*: (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

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_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.