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 SQL statement against a database.
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.
The response size limit is 1 MB. If the call returns more than 1 MB of response data, the call is terminated.
Synopsis
- data ExecuteStatement = ExecuteStatement' {}
- newExecuteStatement :: Text -> Text -> Text -> ExecuteStatement
- executeStatement_database :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_transactionId :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_schema :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_parameters :: Lens' ExecuteStatement (Maybe [SqlParameter])
- executeStatement_includeResultMetadata :: Lens' ExecuteStatement (Maybe Bool)
- executeStatement_resultSetOptions :: Lens' ExecuteStatement (Maybe ResultSetOptions)
- executeStatement_continueAfterTimeout :: Lens' ExecuteStatement (Maybe Bool)
- executeStatement_resourceArn :: Lens' ExecuteStatement Text
- executeStatement_secretArn :: Lens' ExecuteStatement Text
- executeStatement_sql :: Lens' ExecuteStatement Text
- data ExecuteStatementResponse = ExecuteStatementResponse' {
- records :: Maybe [[Field]]
- columnMetadata :: Maybe [ColumnMetadata]
- generatedFields :: Maybe [Field]
- numberOfRecordsUpdated :: Maybe Integer
- httpStatus :: Int
- newExecuteStatementResponse :: Int -> ExecuteStatementResponse
- executeStatementResponse_records :: Lens' ExecuteStatementResponse (Maybe [[Field]])
- executeStatementResponse_columnMetadata :: Lens' ExecuteStatementResponse (Maybe [ColumnMetadata])
- executeStatementResponse_generatedFields :: Lens' ExecuteStatementResponse (Maybe [Field])
- executeStatementResponse_numberOfRecordsUpdated :: Lens' ExecuteStatementResponse (Maybe Integer)
- executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int
Creating a Request
data ExecuteStatement Source #
The request parameters represent the input of a request to run a SQL statement against a database.
See: newExecuteStatement
smart constructor.
ExecuteStatement' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> ExecuteStatement |
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:
$sel:database:ExecuteStatement'
, executeStatement_database
- The name of the database.
$sel:transactionId:ExecuteStatement'
, executeStatement_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:ExecuteStatement'
, executeStatement_schema
- The name of the database schema.
Currently, the schema
parameter isn't supported.
$sel:parameters:ExecuteStatement'
, executeStatement_parameters
- The parameters for the SQL statement.
Array parameters are not supported.
$sel:includeResultMetadata:ExecuteStatement'
, executeStatement_includeResultMetadata
- A value that indicates whether to include metadata in the results.
$sel:resultSetOptions:ExecuteStatement'
, executeStatement_resultSetOptions
- Options that control how the result set is returned.
$sel:continueAfterTimeout:ExecuteStatement'
, executeStatement_continueAfterTimeout
- A value that indicates whether to continue running the statement after
the call times out. By default, the statement stops running when the
call times out.
For DDL statements, we recommend continuing to run the statement after the call times out. When a DDL statement terminates before it is finished running, it can result in errors and possibly corrupted data structures.
$sel:resourceArn:ExecuteStatement'
, executeStatement_resourceArn
- The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
$sel:secretArn:ExecuteStatement'
, executeStatement_secretArn
- The name or ARN of the secret that enables access to the DB cluster.
$sel:sql:ExecuteStatement'
, executeStatement_sql
- The SQL statement to run.
Request Lenses
executeStatement_database :: Lens' ExecuteStatement (Maybe Text) Source #
The name of the database.
executeStatement_transactionId :: Lens' ExecuteStatement (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.
executeStatement_schema :: Lens' ExecuteStatement (Maybe Text) Source #
The name of the database schema.
Currently, the schema
parameter isn't supported.
executeStatement_parameters :: Lens' ExecuteStatement (Maybe [SqlParameter]) Source #
The parameters for the SQL statement.
Array parameters are not supported.
executeStatement_includeResultMetadata :: Lens' ExecuteStatement (Maybe Bool) Source #
A value that indicates whether to include metadata in the results.
executeStatement_resultSetOptions :: Lens' ExecuteStatement (Maybe ResultSetOptions) Source #
Options that control how the result set is returned.
executeStatement_continueAfterTimeout :: Lens' ExecuteStatement (Maybe Bool) Source #
A value that indicates whether to continue running the statement after the call times out. By default, the statement stops running when the call times out.
For DDL statements, we recommend continuing to run the statement after the call times out. When a DDL statement terminates before it is finished running, it can result in errors and possibly corrupted data structures.
executeStatement_resourceArn :: Lens' ExecuteStatement Text Source #
The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
executeStatement_secretArn :: Lens' ExecuteStatement Text Source #
The name or ARN of the secret that enables access to the DB cluster.
executeStatement_sql :: Lens' ExecuteStatement Text Source #
The SQL statement to run.
Destructuring the Response
data ExecuteStatementResponse Source #
The response elements represent the output of a request to run a SQL statement against a database.
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:records:ExecuteStatementResponse'
, executeStatementResponse_records
- The records returned by the SQL statement.
$sel:columnMetadata:ExecuteStatementResponse'
, executeStatementResponse_columnMetadata
- Metadata for the columns included in the results.
$sel:generatedFields:ExecuteStatementResponse'
, executeStatementResponse_generatedFields
- Values for fields generated during the request.
<note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>
$sel:numberOfRecordsUpdated:ExecuteStatementResponse'
, executeStatementResponse_numberOfRecordsUpdated
- The number of records updated by the request.
$sel:httpStatus:ExecuteStatementResponse'
, executeStatementResponse_httpStatus
- The response's http status code.
Response Lenses
executeStatementResponse_records :: Lens' ExecuteStatementResponse (Maybe [[Field]]) Source #
The records returned by the SQL statement.
executeStatementResponse_columnMetadata :: Lens' ExecuteStatementResponse (Maybe [ColumnMetadata]) Source #
Metadata for the columns included in the results.
executeStatementResponse_generatedFields :: Lens' ExecuteStatementResponse (Maybe [Field]) Source #
Values for fields generated during the request.
<note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>
executeStatementResponse_numberOfRecordsUpdated :: Lens' ExecuteStatementResponse (Maybe Integer) Source #
The number of records updated by the request.
executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int Source #
The response's http status code.