#[non_exhaustive]pub struct CreateDatabaseRequest {
pub parent: String,
pub create_statement: String,
pub extra_statements: Vec<String>,
pub encryption_config: Option<EncryptionConfig>,
pub database_dialect: DatabaseDialect,
pub proto_descriptors: Bytes,
/* private fields */
}Expand description
The request for CreateDatabase.
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.parent: StringRequired. The name of the instance that will serve the new database.
Values are of the form projects/<project>/instances/<instance>.
create_statement: StringRequired. A CREATE DATABASE statement, which specifies the ID of the
new database. The database ID must conform to the regular expression
[a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in length.
If the database ID is a reserved word or if it contains a hyphen, the
database ID must be enclosed in backticks (`).
extra_statements: Vec<String>Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.
encryption_config: Option<EncryptionConfig>Optional. The encryption configuration for the database. If this field is not specified, Cloud Spanner will encrypt/decrypt all data at rest using Google default encryption.
database_dialect: DatabaseDialectOptional. The dialect of the Cloud Spanner Database.
proto_descriptors: BytesOptional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
‘extra_statements’ above.
Contains a protobuf-serialized
google.protobuf.FileDescriptorSet.
To generate it, install and
run protoc with –include_imports and –descriptor_set_out. For example,
to generate for moon/shot/app.proto, run
$protoc --proto_path=/app_path --proto_path=/lib_path \
--include_imports \
--descriptor_set_out=descriptors.data \
moon/shot/app.protoFor more details, see protobuffer self description.
Implementations§
Source§impl CreateDatabaseRequest
impl CreateDatabaseRequest
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_create_statement<T: Into<String>>(self, v: T) -> Self
pub fn set_create_statement<T: Into<String>>(self, v: T) -> Self
Sets the value of create_statement.
§Example
let x = CreateDatabaseRequest::new().set_create_statement("example");Sourcepub fn set_extra_statements<T, V>(self, v: T) -> Self
pub fn set_extra_statements<T, V>(self, v: T) -> Self
Sets the value of extra_statements.
§Example
let x = CreateDatabaseRequest::new().set_extra_statements(["a", "b", "c"]);Sourcepub fn set_encryption_config<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfig>,
pub fn set_encryption_config<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfig>,
Sets the value of encryption_config.
§Example
use google_cloud_spanner_admin_database_v1::model::EncryptionConfig;
let x = CreateDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);Sourcepub fn set_or_clear_encryption_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionConfig>,
pub fn set_or_clear_encryption_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionConfig>,
Sets or clears the value of encryption_config.
§Example
use google_cloud_spanner_admin_database_v1::model::EncryptionConfig;
let x = CreateDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
let x = CreateDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);Sourcepub fn set_database_dialect<T: Into<DatabaseDialect>>(self, v: T) -> Self
pub fn set_database_dialect<T: Into<DatabaseDialect>>(self, v: T) -> Self
Sets the value of database_dialect.
§Example
use google_cloud_spanner_admin_database_v1::model::DatabaseDialect;
let x0 = CreateDatabaseRequest::new().set_database_dialect(DatabaseDialect::GoogleStandardSql);
let x1 = CreateDatabaseRequest::new().set_database_dialect(DatabaseDialect::Postgresql);Sourcepub fn set_proto_descriptors<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_proto_descriptors<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of proto_descriptors.
§Example
let x = CreateDatabaseRequest::new().set_proto_descriptors(bytes::Bytes::from_static(b"example"));Trait Implementations§
Source§impl Clone for CreateDatabaseRequest
impl Clone for CreateDatabaseRequest
Source§fn clone(&self) -> CreateDatabaseRequest
fn clone(&self) -> CreateDatabaseRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateDatabaseRequest
impl Debug for CreateDatabaseRequest
Source§impl Default for CreateDatabaseRequest
impl Default for CreateDatabaseRequest
Source§fn default() -> CreateDatabaseRequest
fn default() -> CreateDatabaseRequest
Source§impl Message for CreateDatabaseRequest
impl Message for CreateDatabaseRequest
Source§impl PartialEq for CreateDatabaseRequest
impl PartialEq for CreateDatabaseRequest
impl StructuralPartialEq for CreateDatabaseRequest
Auto Trait Implementations§
impl !Freeze for CreateDatabaseRequest
impl RefUnwindSafe for CreateDatabaseRequest
impl Send for CreateDatabaseRequest
impl Sync for CreateDatabaseRequest
impl Unpin for CreateDatabaseRequest
impl UnsafeUnpin for CreateDatabaseRequest
impl UnwindSafe for CreateDatabaseRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request