- 1.104.0 (latest)
- 1.103.0
- 1.102.0
- 1.101.0
- 1.100.0
- 1.98.0
- 1.97.0
- 1.96.0
- 1.95.0
- 1.94.0
- 1.93.1
- 1.92.1
- 1.91.0
- 1.90.0
- 1.89.0
- 1.88.0
- 1.87.0
- 1.86.0
- 1.85.0
- 1.84.0
- 1.83.0
- 1.82.0
- 1.81.0
- 1.80.0
- 1.79.0
- 1.78.0
- 1.77.0
- 1.76.1
- 1.68.0
- 1.67.0
- 1.66.0
- 1.65.0
- 1.64.0
- 1.63.2
- 1.62.1
- 1.61.0
- 1.60.0
- 1.59.0
- 1.58.4
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.2
Reference documentation and code samples for the Cloud Spanner V1 Client class Database.
A Cloud Spanner database.
Generated from protobuf message google.spanner.admin.database.v1.Database
Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ 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
int
Output only. The current database state.
↳ create_time
Google\Protobuf\Timestamp
Output only. If exists, the time at which the database creation started.
↳ restore_info
Google\Cloud\Spanner\Admin\Database\V1\RestoreInfo
Output only. Applicable only for restored databases. Contains information about the restore source.
↳ encryption_config
Google\Cloud\Spanner\Admin\Database\V1\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
array< Google\Cloud\Spanner\Admin\Database\V1\EncryptionInfo
>
Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use. 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 . Defaults to 1 hour, if not set.
↳ earliest_version_time
Google\Protobuf\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
int
Output only. The dialect of the Cloud Spanner Database.
getName
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.
Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED];
string
setName
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.
Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED];
var
string
$this
getState
Output only. The current database state.
Generated from protobuf field .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
int
setState
Output only. The current database state.
Generated from protobuf field .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
int
$this
getCreateTime
Output only. If exists, the time at which the database creation started.
Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
Google\Protobuf\Timestamp|null
hasCreateTime
clearCreateTime
setCreateTime
Output only. If exists, the time at which the database creation started.
Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
Google\Protobuf\Timestamp
$this
getRestoreInfo
Output only. Applicable only for restored databases. Contains information about the restore source.
Generated from protobuf field .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
hasRestoreInfo
clearRestoreInfo
setRestoreInfo
Output only. Applicable only for restored databases. Contains information about the restore source.
Generated from protobuf field .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
$this
getEncryptionConfig
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.
Generated from protobuf field .google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
hasEncryptionConfig
clearEncryptionConfig
setEncryptionConfig
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.
Generated from protobuf field .google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
$this
getEncryptionInfo
Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use.
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.
Generated from protobuf field repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Google\Protobuf\Internal\RepeatedField
setEncryptionInfo
Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use.
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.
Generated from protobuf field repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
$this
getVersionRetentionPeriod
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 . Defaults to 1 hour, if not set.
Generated from protobuf field string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
string
setVersionRetentionPeriod
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 . Defaults to 1 hour, if not set.
Generated from protobuf field string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
string
$this
getEarliestVersionTime
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.
Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
Google\Protobuf\Timestamp|null
hasEarliestVersionTime
clearEarliestVersionTime
setEarliestVersionTime
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.
Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
Google\Protobuf\Timestamp
$this
getDefaultLeader
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.
Generated from protobuf field string default_leader = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
string
setDefaultLeader
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.
Generated from protobuf field string default_leader = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
string
$this
getDatabaseDialect
Output only. The dialect of the Cloud Spanner Database.
Generated from protobuf field .google.spanner.admin.database.v1.DatabaseDialect database_dialect = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
int
setDatabaseDialect
Output only. The dialect of the Cloud Spanner Database.
Generated from protobuf field .google.spanner.admin.database.v1.DatabaseDialect database_dialect = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
var
int
$this