Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
Synopsis
- data BatchExecuteStatement = BatchExecuteStatement' {
- database :: Maybe Text
- parameterSets :: Maybe [[SqlParameter]]
- transactionId :: Maybe Text
- schema :: Maybe Text
- resourceArn :: Text
- secretArn :: Text
- sql :: Text
- newBatchExecuteStatement :: Text -> Text -> Text -> BatchExecuteStatement
- batchExecuteStatement_database :: Lens' BatchExecuteStatement (Maybe Text)
- batchExecuteStatement_parameterSets :: Lens' BatchExecuteStatement (Maybe [[SqlParameter]])
- batchExecuteStatement_transactionId :: Lens' BatchExecuteStatement (Maybe Text)
- batchExecuteStatement_schema :: Lens' BatchExecuteStatement (Maybe Text)
- batchExecuteStatement_resourceArn :: Lens' BatchExecuteStatement Text
- batchExecuteStatement_secretArn :: Lens' BatchExecuteStatement Text
- batchExecuteStatement_sql :: Lens' BatchExecuteStatement Text
- data BatchExecuteStatementResponse = BatchExecuteStatementResponse' {
- updateResults :: Maybe [UpdateResult]
- httpStatus :: Int
- newBatchExecuteStatementResponse :: Int -> BatchExecuteStatementResponse
- batchExecuteStatementResponse_updateResults :: Lens' BatchExecuteStatementResponse (Maybe [UpdateResult])
- batchExecuteStatementResponse_httpStatus :: Lens' BatchExecuteStatementResponse Int
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.
BatchExecuteStatement' | |
|
Instances
newBatchExecuteStatement Source #
:: Text | |
-> Text | |
-> Text | |
-> BatchExecuteStatement |
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 theBatchExecuteStatement
operation.
Array parameters are not 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:schema:BatchExecuteStatement'
, batchExecuteStatement_schema
- The name of the database schema.
$sel:resourceArn:BatchExecuteStatement'
, batchExecuteStatement_resourceArn
- The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
$sel:secretArn:BatchExecuteStatement'
, batchExecuteStatement_secretArn
- The name or ARN of the secret that enables access to the DB cluster.
$sel:sql:BatchExecuteStatement'
, batchExecuteStatement_sql
- The SQL statement to run.
Request Lenses
batchExecuteStatement_database :: Lens' BatchExecuteStatement (Maybe Text) Source #
The name of the database.
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 theBatchExecuteStatement
operation.
Array parameters are not 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_schema :: Lens' BatchExecuteStatement (Maybe Text) Source #
The name of the database schema.
batchExecuteStatement_resourceArn :: Lens' BatchExecuteStatement Text Source #
The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
batchExecuteStatement_secretArn :: Lens' BatchExecuteStatement Text Source #
The name or ARN of the secret that enables access to the DB cluster.
batchExecuteStatement_sql :: Lens' BatchExecuteStatement Text Source #
The SQL statement to run.
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.
BatchExecuteStatementResponse' | |
|
Instances
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
batchExecuteStatementResponse_updateResults :: Lens' BatchExecuteStatementResponse (Maybe [UpdateResult]) Source #
The execution results of each batch entry.
batchExecuteStatementResponse_httpStatus :: Lens' BatchExecuteStatementResponse Int Source #
The response's http status code.