amazonka-rds-data-2.0: Amazon RDS DataService 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.RDSData.BatchExecuteStatement

Description

Runs a batch SQL statement over an array of data.

You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.

If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically.

There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set.

The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.

Synopsis

Creating a Request

data BatchExecuteStatement Source #

The request parameters represent the input of a SQL statement over an array of data.

See: newBatchExecuteStatement smart constructor.

Constructors

BatchExecuteStatement' 

Fields

  • database :: Maybe Text

    The name of the database.

  • parameterSets :: Maybe [[SqlParameter]]

    The parameter set for the batch operation.

    The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:

    • Specify one or more empty parameter sets.
    • Use the ExecuteStatement operation instead of the BatchExecuteStatement operation.

    Array parameters are not supported.

  • schema :: Maybe Text

    The name of the database schema.

    Currently, the schema parameter isn't supported.

  • transactionId :: Maybe Text

    The identifier of a transaction that was started by using the BeginTransaction operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.

    If the SQL statement is not part of a transaction, don't set this parameter.

  • resourceArn :: Text

    The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

  • secretArn :: Text

    The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

    For information about creating the secret, see Create a database secret.

  • sql :: Text

    The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.

Instances

Instances details
ToJSON BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

ToHeaders BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

ToPath BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

ToQuery BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

AWSRequest BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Associated Types

type AWSResponse BatchExecuteStatement #

Generic BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Associated Types

type Rep BatchExecuteStatement :: Type -> Type #

Read BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Show BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

NFData BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Methods

rnf :: BatchExecuteStatement -> () #

Eq BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Hashable BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

type AWSResponse BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

type Rep BatchExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

type Rep BatchExecuteStatement = D1 ('MetaData "BatchExecuteStatement" "Amazonka.RDSData.BatchExecuteStatement" "amazonka-rds-data-2.0-IBcRzqxHiGyCjqyJwy4iJz" 'False) (C1 ('MetaCons "BatchExecuteStatement'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "database") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "parameterSets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [[SqlParameter]])) :*: S1 ('MetaSel ('Just "schema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "transactionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "resourceArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "secretArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "sql") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newBatchExecuteStatement Source #

Create a value of BatchExecuteStatement 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:database:BatchExecuteStatement', batchExecuteStatement_database - The name of the database.

$sel:parameterSets:BatchExecuteStatement', batchExecuteStatement_parameterSets - The parameter set for the batch operation.

The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:

  • Specify one or more empty parameter sets.
  • Use the ExecuteStatement operation instead of the BatchExecuteStatement operation.

Array parameters are not supported.

$sel:schema:BatchExecuteStatement', batchExecuteStatement_schema - The name of the database schema.

Currently, the schema parameter isn't supported.

$sel:transactionId:BatchExecuteStatement', batchExecuteStatement_transactionId - The identifier of a transaction that was started by using the BeginTransaction operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.

If the SQL statement is not part of a transaction, don't set this parameter.

$sel:resourceArn:BatchExecuteStatement', batchExecuteStatement_resourceArn - The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

$sel:secretArn:BatchExecuteStatement', batchExecuteStatement_secretArn - The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

For information about creating the secret, see Create a database secret.

$sel:sql:BatchExecuteStatement', batchExecuteStatement_sql - The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.

Request Lenses

batchExecuteStatement_parameterSets :: Lens' BatchExecuteStatement (Maybe [[SqlParameter]]) Source #

The parameter set for the batch operation.

The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:

  • Specify one or more empty parameter sets.
  • Use the ExecuteStatement operation instead of the BatchExecuteStatement operation.

Array parameters are not supported.

batchExecuteStatement_schema :: Lens' BatchExecuteStatement (Maybe Text) Source #

The name of the database schema.

Currently, the schema parameter isn't supported.

batchExecuteStatement_transactionId :: Lens' BatchExecuteStatement (Maybe Text) Source #

The identifier of a transaction that was started by using the BeginTransaction operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.

If the SQL statement is not part of a transaction, don't set this parameter.

batchExecuteStatement_resourceArn :: Lens' BatchExecuteStatement Text Source #

The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

batchExecuteStatement_secretArn :: Lens' BatchExecuteStatement Text Source #

The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

For information about creating the secret, see Create a database secret.

batchExecuteStatement_sql :: Lens' BatchExecuteStatement Text Source #

The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.

Destructuring the Response

data BatchExecuteStatementResponse Source #

The response elements represent the output of a SQL statement over an array of data.

See: newBatchExecuteStatementResponse smart constructor.

Constructors

BatchExecuteStatementResponse' 

Fields

Instances

Instances details
Generic BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Associated Types

type Rep BatchExecuteStatementResponse :: Type -> Type #

Read BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Show BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

NFData BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

Eq BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

type Rep BatchExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.BatchExecuteStatement

type Rep BatchExecuteStatementResponse = D1 ('MetaData "BatchExecuteStatementResponse" "Amazonka.RDSData.BatchExecuteStatement" "amazonka-rds-data-2.0-IBcRzqxHiGyCjqyJwy4iJz" 'False) (C1 ('MetaCons "BatchExecuteStatementResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "updateResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [UpdateResult])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newBatchExecuteStatementResponse Source #

Create a value of BatchExecuteStatementResponse 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:updateResults:BatchExecuteStatementResponse', batchExecuteStatementResponse_updateResults - The execution results of each batch entry.

$sel:httpStatus:BatchExecuteStatementResponse', batchExecuteStatementResponse_httpStatus - The response's http status code.

Response Lenses