#[non_exhaustive]pub struct ExecuteSqlPayload {
pub user: String,
pub sql_statement: String,
pub database: String,
pub row_limit: i64,
pub partial_result_mode: PartialResultMode,
pub user_password: Option<UserPassword>,
/* private fields */
}Expand description
The request payload used to execute SQL statements.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.user: StringOptional. The name of an existing database user to connect to the database.
When auto_iam_authn is set to true, this field is ignored and the API
caller’s IAM user is used.
sql_statement: StringRequired. SQL statements to run on the database. It can be a single statement or a sequence of statements separated by semicolons.
database: StringOptional. Name of the database on which the statement will be executed.
row_limit: i64Optional. The maximum number of rows returned per SQL statement.
partial_result_mode: PartialResultModeOptional. Controls how the API should respond when the SQL execution result is incomplete due to the size limit or another error. The default mode is to throw an error.
user_password: Option<UserPassword>Credentials for the database connection.
Implementations§
Source§impl ExecuteSqlPayload
impl ExecuteSqlPayload
pub fn new() -> Self
Sourcepub fn set_sql_statement<T: Into<String>>(self, v: T) -> Self
pub fn set_sql_statement<T: Into<String>>(self, v: T) -> Self
Sets the value of sql_statement.
§Example
let x = ExecuteSqlPayload::new().set_sql_statement("example");Sourcepub fn set_database<T: Into<String>>(self, v: T) -> Self
pub fn set_database<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_row_limit<T: Into<i64>>(self, v: T) -> Self
pub fn set_row_limit<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_partial_result_mode<T: Into<PartialResultMode>>(self, v: T) -> Self
pub fn set_partial_result_mode<T: Into<PartialResultMode>>(self, v: T) -> Self
Sets the value of partial_result_mode.
§Example
use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);Sourcepub fn set_user_password<T: Into<Option<UserPassword>>>(self, v: T) -> Self
pub fn set_user_password<T: Into<Option<UserPassword>>>(self, v: T) -> Self
Sets the value of user_password.
Note that all the setters affecting user_password are mutually
exclusive.
§Example
use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));Sourcepub fn auto_iam_authn(&self) -> Option<&bool>
pub fn auto_iam_authn(&self) -> Option<&bool>
The value of user_password
if it holds a AutoIamAuthn, None if the field is not set or
holds a different branch.
Sourcepub fn set_auto_iam_authn<T: Into<bool>>(self, v: T) -> Self
pub fn set_auto_iam_authn<T: Into<bool>>(self, v: T) -> Self
Sets the value of user_password
to hold a AutoIamAuthn.
Note that all the setters affecting user_password are
mutually exclusive.
§Example
let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
assert!(x.auto_iam_authn().is_some());Trait Implementations§
Source§impl Clone for ExecuteSqlPayload
impl Clone for ExecuteSqlPayload
Source§fn clone(&self) -> ExecuteSqlPayload
fn clone(&self) -> ExecuteSqlPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more