|
Google Cloud Spanner C++ Client
0.10.0
A C++ Client Library for Google Cloud Spanner
|
This class identifies a Cloud Spanner Database. More...
#include <google/cloud/spanner/database.h>
Public Member Functions | |
| Database (Instance instance, std::string database_id) | |
Constructs a Database object identified by the given database_id and instance. More... | |
| Database (std::string project_id, std::string instance_id, std::string database_id) | |
| Constructs a Database object identified by the given IDs. More... | |
| std::string | FullName () const |
| Returns the fully qualified database name as a string of the form: "projects/<project-id>/instances/<instance-id>/databases/<database-id>". More... | |
| Instance const & | instance () const |
Returns the Instance containing this database. More... | |
| std::string const & | database_id () const |
Copy and move | |
| Database (Database const &)=default | |
| Database & | operator= (Database const &)=default |
| Database (Database &&)=default | |
| Database & | operator= (Database &&)=default |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Database const &dn) |
Output the FullName() format. More... | |
Equality operators | |
| bool | operator== (Database const &a, Database const &b) |
| bool | operator!= (Database const &a, Database const &b) |
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
Definition at line 43 of file database.h.
| google::cloud::spanner::v0::Database::Database | ( | Instance | instance, |
| std::string | database_id | ||
| ) |
Constructs a Database object identified by the given database_id and instance.
Definition at line 23 of file database.cc.
| google::cloud::spanner::v0::Database::Database | ( | std::string | project_id, |
| std::string | instance_id, | ||
| std::string | database_id | ||
| ) |
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 then calling the Database(Instance, std::string) constructor.
Definition at line 26 of file database.cc.
|
default |
|
default |
|
inline |
Definition at line 75 of file database.h.
| std::string google::cloud::spanner::v0::Database::FullName | ( | ) | const |
Returns the fully qualified database name as a string of the form: "projects/<project-id>/instances/<instance-id>/databases/<database-id>".
Definition at line 31 of file database.cc.
|
inline |
Returns the Instance containing this database.
Definition at line 74 of file database.h.
Definition at line 39 of file database.cc.
|
friend |
Output the FullName() format.
Definition at line 41 of file database.cc.
Definition at line 35 of file database.cc.
1.8.15