#[non_exhaustive]pub struct Database {
pub name: String,
pub state: State,
pub create_time: Option<Timestamp>,
pub restore_info: Option<RestoreInfo>,
pub encryption_config: Option<EncryptionConfig>,
pub encryption_info: Vec<EncryptionInfo>,
pub version_retention_period: String,
pub earliest_version_time: Option<Timestamp>,
pub default_leader: String,
pub database_dialect: DatabaseDialect,
pub enable_drop_protection: bool,
pub reconciling: bool,
}Expand description
A Cloud Spanner database.
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.name: StringRequired. The name of the database. Values are of the form
projects/<project>/instances/<instance>/databases/<database>,
where <database> is as specified in the CREATE DATABASE
statement. This name can be passed to other API methods to
identify the database.
state: StateOutput only. The current database state.
create_time: Option<Timestamp>Output only. If exists, the time at which the database creation started.
restore_info: Option<RestoreInfo>Output only. Applicable only for restored databases. Contains information about the restore source.
encryption_config: Option<EncryptionConfig>Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
encryption_info: Vec<EncryptionInfo>Output only. For databases that are using customer managed encryption, this
field contains the encryption information for the database, such as
all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.
For databases that are using Google default or other types of encryption, this field is empty.
This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
version_retention_period: StringOutput only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
earliest_version_time: Option<Timestamp>Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
default_leader: StringOutput only. The read-write region which contains the database’s leader replicas.
This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
database_dialect: DatabaseDialectOutput only. The dialect of the Cloud Spanner Database.
enable_drop_protection: boolWhether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.
reconciling: boolOutput only. If true, the database is being updated. If false, there are no ongoing update operations for the database.
Implementations§
Source§impl Database
impl Database
pub fn new() -> Self
Sourcepub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_restore_info<T: Into<Option<RestoreInfo>>>(self, v: T) -> Self
pub fn set_restore_info<T: Into<Option<RestoreInfo>>>(self, v: T) -> Self
Sets the value of restore_info.
Sourcepub fn set_encryption_config<T: Into<Option<EncryptionConfig>>>(
self,
v: T,
) -> Self
pub fn set_encryption_config<T: Into<Option<EncryptionConfig>>>( self, v: T, ) -> Self
Sets the value of encryption_config.
Sourcepub fn set_version_retention_period<T: Into<String>>(self, v: T) -> Self
pub fn set_version_retention_period<T: Into<String>>(self, v: T) -> Self
Sets the value of version_retention_period.
Sourcepub fn set_earliest_version_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_earliest_version_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of earliest_version_time.
Sourcepub fn set_default_leader<T: Into<String>>(self, v: T) -> Self
pub fn set_default_leader<T: Into<String>>(self, v: T) -> Self
Sets the value of default_leader.
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.
Sourcepub fn set_enable_drop_protection<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_drop_protection<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_drop_protection.
Sourcepub fn set_reconciling<T: Into<bool>>(self, v: T) -> Self
pub fn set_reconciling<T: Into<bool>>(self, v: T) -> Self
Sets the value of reconciling.
Sourcepub fn set_encryption_info<T, V>(self, v: T) -> Self
pub fn set_encryption_info<T, V>(self, v: T) -> Self
Sets the value of encryption_info.