aws_sdk_rdsdata/client/
execute_statement.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`ExecuteStatement`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`resource_arn(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::resource_arn) / [`set_resource_arn(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_resource_arn):<br>required: **true**<br><p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p><br>
7    ///   - [`secret_arn(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::secret_arn) / [`set_secret_arn(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_secret_arn):<br>required: **true**<br><p>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.</p> <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p><br>
8    ///   - [`sql(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::sql) / [`set_sql(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_sql):<br>required: **true**<br><p>The SQL statement to run.</p><br>
9    ///   - [`database(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::database) / [`set_database(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_database):<br>required: **false**<br><p>The name of the database.</p><br>
10    ///   - [`schema(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::schema) / [`set_schema(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_schema):<br>required: **false**<br><p>The name of the database schema.</p><note>  <p>Currently, the <code>schema</code> parameter isn't supported.</p> </note><br>
11    ///   - [`parameters(SqlParameter)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::parameters) / [`set_parameters(Option<Vec::<SqlParameter>>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_parameters):<br>required: **false**<br><p>The parameters for the SQL statement.</p><note>  <p>Array parameters are not supported.</p> </note><br>
12    ///   - [`transaction_id(impl Into<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::transaction_id) / [`set_transaction_id(Option<String>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_transaction_id):<br>required: **false**<br><p>The identifier of a transaction that was started by using the <code>BeginTransaction</code> operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.</p> <p>If the SQL statement is not part of a transaction, don't set this parameter.</p><br>
13    ///   - [`include_result_metadata(bool)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::include_result_metadata) / [`set_include_result_metadata(Option<bool>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_include_result_metadata):<br>required: **false**<br><p>A value that indicates whether to include metadata in the results.</p><br>
14    ///   - [`continue_after_timeout(bool)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::continue_after_timeout) / [`set_continue_after_timeout(Option<bool>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_continue_after_timeout):<br>required: **false**<br><p>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.</p><note>  <p>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.</p> </note><br>
15    ///   - [`result_set_options(ResultSetOptions)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::result_set_options) / [`set_result_set_options(Option<ResultSetOptions>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_result_set_options):<br>required: **false**<br><p>Options that control how the result set is returned.</p><br>
16    ///   - [`format_records_as(RecordsFormatType)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::format_records_as) / [`set_format_records_as(Option<RecordsFormatType>)`](crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::set_format_records_as):<br>required: **false**<br><p>A value that indicates whether to format the result set as a single JSON string. This parameter only applies to <code>SELECT</code> statements and is ignored for other types of statements. Allowed values are <code>NONE</code> and <code>JSON</code>. The default value is <code>NONE</code>. The result is returned in the <code>formattedRecords</code> field.</p> <p>For usage information about the JSON format for result sets, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API</a> in the <i>Amazon Aurora User Guide</i>.</p><br>
17    /// - On success, responds with [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput) with field(s):
18    ///   - [`records(Option<Vec::<Vec::<Field>>>)`](crate::operation::execute_statement::ExecuteStatementOutput::records): <p>The records returned by the SQL statement. This field is blank if the <code>formatRecordsAs</code> parameter is set to <code>JSON</code>.</p>
19    ///   - [`column_metadata(Option<Vec::<ColumnMetadata>>)`](crate::operation::execute_statement::ExecuteStatementOutput::column_metadata): <p>Metadata for the columns included in the results. This field is blank if the <code>formatRecordsAs</code> parameter is set to <code>JSON</code>.</p>
20    ///   - [`number_of_records_updated(i64)`](crate::operation::execute_statement::ExecuteStatementOutput::number_of_records_updated): <p>The number of records updated by the request.</p>
21    ///   - [`generated_fields(Option<Vec::<Field>>)`](crate::operation::execute_statement::ExecuteStatementOutput::generated_fields): <p>Values for fields generated during a DML request.</p><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>
22    ///   - [`formatted_records(Option<String>)`](crate::operation::execute_statement::ExecuteStatementOutput::formatted_records): <p>A string value that represents the result set of a <code>SELECT</code> statement in JSON format. This value is only present when the <code>formatRecordsAs</code> parameter is set to <code>JSON</code>.</p> <p>The size limit for this field is currently 10 MB. If the JSON-formatted string representing the result set requires more than 10 MB, the call returns an error.</p>
23    /// - On failure, responds with [`SdkError<ExecuteStatementError>`](crate::operation::execute_statement::ExecuteStatementError)
24    pub fn execute_statement(&self) -> crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder {
25        crate::operation::execute_statement::builders::ExecuteStatementFluentBuilder::new(self.handle.clone())
26    }
27}