Class Database (2.14.0)

This class identifies a Cloud Spanner Database.

A Cloud Spanner database is identified by its project_id, instance_id, and database_id.

For more info about the database_id format, see https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.CreateDatabaseRequest

Constructors

Database(Database const &)

Copy and move

Parameter
Name Description
Database const &

Database(Database &&)

Copy and move

Parameter
Name Description
Database &&

Database(Instance, std::string)

Constructs a Database object identified by the given instance and database_id.

Parameters
Name Description
instance Instance
database_id std::string

Database(std::string, std::string, std::string)

Constructs a Database object identified by the given IDs.

This is equivalent to first constructing an Instance from the given project_id and instance_id arguments and then calling the Database(Instance, std::string) constructor.

Parameters
Name Description
project_id std::string
instance_id std::string
database_id std::string

Operators

operator=(Database const &)

Copy and move

Parameter
Name Description
Database const &
Returns
Type Description
Database &

operator=(Database &&)

Copy and move

Parameter
Name Description
Database &&
Returns
Type Description
Database &

Functions

instance() const

Returns the Instance containing this database.

Returns
Type Description
Instance const &

database_id() const

Returns the Database ID.

Returns
Type Description
std::string const &

FullName() const

Returns the fully qualified database name as a string of the form: "projects/

Returns
Type Description
std::string