pub struct Database {
pub name: String,
pub state: i32,
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: i32,
pub enable_drop_protection: bool,
pub reconciling: bool,
}
Expand description
A Cloud Spanner database.
Fields§
§name: String
Required. 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: i32
Output 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: String
Output 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][google.spanner.admin.database.v1.DatabaseAdmin.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: String
Output 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: i32
Output only. The dialect of the Cloud Spanner Database.
enable_drop_protection: bool
Whether 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: bool
Output 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
sourcepub fn state(&self) -> State
pub fn state(&self) -> State
Returns the enum value of state
, or the default if the field is set to an invalid enum value.
sourcepub fn database_dialect(&self) -> DatabaseDialect
pub fn database_dialect(&self) -> DatabaseDialect
Returns the enum value of database_dialect
, or the default if the field is set to an invalid enum value.
sourcepub fn set_database_dialect(&mut self, value: DatabaseDialect)
pub fn set_database_dialect(&mut self, value: DatabaseDialect)
Sets database_dialect
to the provided enum value.
Trait Implementations§
source§impl Message for Database
impl Message for Database
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Database
impl PartialEq for Database
impl StructuralPartialEq for Database
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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