MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cpp-samples / GetSpannerClient

Function GetSpannerClient

getting-started/index_gcs_prefix.cc:45–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45spanner::Client GetSpannerClient() {
46 static auto const client = [&] {
47 auto database = spanner::Database(GetEnv("GOOGLE_CLOUD_PROJECT"),
48 GetEnv("SPANNER_INSTANCE"),
49 GetEnv("SPANNER_DATABASE"));
50 return spanner::Client(spanner::MakeConnection(std::move(database)));
51 }();
52 return client;
53}
54
55void ThrowIfNotOkay(std::string const& context,
56 google::cloud::Status const& status) {

Callers 1

IndexGcsPrefixFunction · 0.70

Calls 1

GetEnvFunction · 0.70

Tested by

no test coverage detected