Skip to main content

aws_sdk_redshiftdata/client/
batch_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 [`BatchExecuteStatement`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`sqls(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::sqls) / [`set_sqls(Option<Vec::<String>>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_sqls):<br>required: **true**<br><p>One or more SQL statements to run. The SQL statements run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. By default, the SQL statements are run as a single transaction. If any SQL statement fails, all work is rolled back. To change this behavior, see the <code>ExecutionMode</code> parameter.</p><br>
7    ///   - [`cluster_identifier(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::cluster_identifier) / [`set_cluster_identifier(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_cluster_identifier):<br>required: **false**<br><p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p><br>
8    ///   - [`secret_arn(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::secret_arn) / [`set_secret_arn(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_secret_arn):<br>required: **false**<br><p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p><br>
9    ///   - [`db_user(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::db_user) / [`set_db_user(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_db_user):<br>required: **false**<br><p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p><br>
10    ///   - [`database(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::database) / [`set_database(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_database):<br>required: **false**<br><p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p><br>
11    ///   - [`with_event(bool)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::with_event) / [`set_with_event(Option<bool>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_with_event):<br>required: **false**<br><p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.</p><br>
12    ///   - [`statement_name(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::statement_name) / [`set_statement_name(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_statement_name):<br>required: **false**<br><p>The name of the SQL statements. You can name the SQL statements when you create them to identify the query.</p><br>
13    ///   - [`parameters(SqlParameter)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::parameters) / [`set_parameters(Option<Vec::<SqlParameter>>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_parameters):<br>required: **false**<br><p>The parameters for the SQL statements. The parameters are available to all SQL statements in the batch. Each statement can reference any subset of the provided parameters. Each provided parameter must be referenced by at least one SQL statement in the batch.</p><br>
14    ///   - [`workgroup_name(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::workgroup_name) / [`set_workgroup_name(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_workgroup_name):<br>required: **false**<br><p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p><br>
15    ///   - [`client_token(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_client_token):<br>required: **false**<br><p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p><br>
16    ///   - [`result_format(ResultFormatString)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::result_format) / [`set_result_format(Option<ResultFormatString>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_result_format):<br>required: **false**<br><p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p><br>
17    ///   - [`session_keep_alive_seconds(i32)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::session_keep_alive_seconds) / [`set_session_keep_alive_seconds(Option<i32>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_session_keep_alive_seconds):<br>required: **false**<br><p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p><br>
18    ///   - [`session_id(impl Into<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::session_id) / [`set_session_id(Option<String>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_session_id):<br>required: **false**<br><p>The session identifier of the query.</p><br>
19    ///   - [`execution_mode(ExecutionMode)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::execution_mode) / [`set_execution_mode(Option<ExecutionMode>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_execution_mode):<br>required: **false**<br><p>Determines how the SQL statements in the batch are run. If set to <code>TRANSACTION</code> (the default), all SQL statements are run as a single transaction and they are committed or rolled back together. If set to <code>AUTO_COMMIT</code>, each SQL statement is committed individually, and a failure of one statement does not affect the others.</p><br>
20    ///   - [`wait_time_seconds(i32)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::wait_time_seconds) / [`set_wait_time_seconds(Option<i32>)`](crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::set_wait_time_seconds):<br>required: **false**<br><p>The number of seconds to wait for all SQL statements in the batch to complete execution before returning the response. If the SQL statements do not complete within the specified time, the response returns the current status. The maximum value is 30 seconds.</p><br>
21    /// - On success, responds with [`BatchExecuteStatementOutput`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput) with field(s):
22    ///   - [`id(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::id): <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by <code>BatchExecuteStatment</code>.</p>
23    ///   - [`created_at(Option<DateTime>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::created_at): <p>The date and time (UTC) the statement was created.</p>
24    ///   - [`cluster_identifier(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::cluster_identifier): <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
25    ///   - [`db_user(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::db_user): <p>The database user name.</p>
26    ///   - [`db_groups(Option<Vec::<String>>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::db_groups): <p>A list of colon (:) separated names of database groups.</p>
27    ///   - [`database(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::database): <p>The name of the database.</p>
28    ///   - [`secret_arn(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::secret_arn): <p>The name or ARN of the secret that enables access to the database.</p>
29    ///   - [`workgroup_name(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::workgroup_name): <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
30    ///   - [`session_id(Option<String>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::session_id): <p>The session identifier of the query.</p>
31    ///   - [`status(Option<StatementStatusString>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::status): <p>The status of the SQL statement. Status values are defined as follows:</p> <ul>  <li>   <p>ABORTED - The query run was stopped by the user.</p></li>  <li>   <p>FAILED - The query run failed.</p></li>  <li>   <p>FINISHED - The query has finished running.</p></li>  <li>   <p>PICKED - The query has been chosen to be run.</p></li>  <li>   <p>STARTED - The query run has started.</p></li>  <li>   <p>SUBMITTED - The query was submitted, but not yet processed.</p></li> </ul>
32    ///   - [`redshift_pid(Option<i64>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::redshift_pid): <p>The process identifier from Amazon Redshift.</p>
33    ///   - [`has_result_set(Option<bool>)`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput::has_result_set): <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set. The value is true if any substatement returns a result set.</p>
34    /// - On failure, responds with [`SdkError<BatchExecuteStatementError>`](crate::operation::batch_execute_statement::BatchExecuteStatementError)
35    pub fn batch_execute_statement(&self) -> crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder {
36        crate::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder::new(self.handle.clone())
37    }
38}