15 #include "google/cloud/spanner/database.h"
25 : instance_
(std::move(instance)
), database_id_(std::move(database_id)) {}
28 std::string database_id)
30 std::move(database_id)
) {}
33 return instance_
.FullName() +
"/databases/" + database_id_;
37 return a.instance_
== b.instance_ && a.database_id_ == b.database_id_;
42 std::ostream& operator<<(std::ostream& os,
Database const& db) {
47 std::regex re(
"projects/([^/]+)/instances/([^/]+)/databases/([^/]+)");
49 if (!std::regex_match(full_name, matches, re)) {
51 "Improperly formatted Database: " + full_name
);
54 std::move(matches[3])
);