forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspanner-main.dox
More file actions
171 lines (110 loc) · 6.23 KB
/
spanner-main.dox
File metadata and controls
171 lines (110 loc) · 6.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*!
@mainpage Cloud Spanner C++ Client Library
The Cloud Spanner C++ Client library offers types and functions to use Cloud
Spanner from C++ applications.
@tableofcontents{HTML:2}
## Quickstart
The following "Hello World" program should give you a sense of how to use this
library. This program is also used to illustrate how to incorporate the library
into your project.
@snippet quickstart.cc all
## More Information
- Read more about [Cloud Spanner](https://cloud.google.com/spanner/docs/)
- [Client::ExecuteQuery()](@ref google::cloud::spanner::Client::ExecuteQuery())
to execute SQL queries in Cloud Spanner.
- [Client::Commit()](@ref google::cloud::spanner::Client::Commit())
to execute read-write transactions in Cloud Spanner.
- [Client::Read()](@ref google::cloud::spanner::Client::Read()) to read the
rows in a table.
- @ref spanner-error-handling to learn how the library reports run-time errors.
- @ref spanner-env for environment variables affecting the library. Some of
these environment variables enable logging to the console. This can be an
effective approach to diagnose runtime problems.
- @ref spanner-retry-policies to learn how to override the default retry
policies used by the library.
- @ref spanner-endpoint-example
- @ref spanner-auth-example
- @ref spanner-universe-domain-example
- @ref spanner-mocking
- @ref spanner-isolation-level-example
- The [Setting up your development environment] guide describes how to set up
a C++ development environment in various platforms, including the Google Cloud
C++ client libraries.
[google-cloud-cpp]: https://github.com/googleapis/google-cloud-cpp
[project-readme]: https://github.com/googleapis/google-cloud-cpp#readme
[project-build]: https://github.com/googleapis/google-cloud-cpp#building-and-installing
[howto-setup-dev-workstation]: https://github.com/googleapis/google-cloud-cpp/blob/main/doc/contributor/howto-guide-setup-development-workstation.md
[quickstart guide]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/bigtable/quickstart#readme
[packaging guide]: https://github.com/googleapis/google-cloud-cpp/blob/main/doc/packaging%2Emd
[Setting up your development environment]: https://cloud.google.com/cpp/docs/setup
*/
/**
@page spanner-endpoint-example Override the default endpoint
In some cases, you may need to override the default endpoint used by the client
library. Use the `google::cloud::EndpointOption` when initializing the client
library to change this default. For example, this will override the default
endpoint for `google::cloud::spanner::Client`:
@snippet client_samples.cc set-client-endpoint
Follow these links to find examples for other `*Client` classes:
- [`DatabaseAdminClient`](@ref DatabaseAdminClient-set-endpoint-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-set-endpoint-snippet)
*/
/**
@page spanner-isolation-level-example Support Isolation Level
Cloud Spanner supports different isolation levels for read-write transactions.
You can specify a default isolation level at the client-level, or override it
at the transaction-level.
The following example shows how to set the isolation level:
@snippet samples.cc spanner-isolation-level-setting-sample
*/
/**
@page spanner-auth-example Override the authentication configuration
Some applications cannot use the default authentication mechanism (known as
[Application Default Credentials]). You can override this default using
`google::cloud::UnifiedCredentialsOption`. The following example shows how
to explicitly load a service account key file.
@snippet client_samples.cc with-service-account
Keep in mind that we chose this as an example because it is relatively easy to
understand. Consult the [Best practices for managing service account keys]
guide for more details.
Follow these links to find examples for other `*Client` classes:
- [`DatabaseAdminClient`](@ref DatabaseAdminClient-with-service-account-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-with-service-account-snippet)
*/
/**
@page spanner-universe-domain-example Override the default universe domain
In some cases, you may need to override the default universe domain used by the
client library. Use the `AddUniverseDomainOption` when initializing the client
library to change this default.
@snippet client_samples.cc set-client-universe-domain
Follow these links to find examples for other `*Client` classes:
- [`DatabaseAdminClient`](@ref DatabaseAdminClient-set-universe-domain-snippet)
- [`InstanceAdminClient`](@ref InstanceAdminClient-set-universe-domain-snippet)
*/
/*! @page Client-set-endpoint-snippet Override Client Default Endpoint
@snippet google/cloud/spanner/samples/client_samples.cc set-client-endpoint
*/
/*! @page Client-with-service-account-snippet Override Client Default Authentication
@snippet google/cloud/spanner/samples/client_samples.cc with-service-account
*/
/*! @page Client-set-universe-domain-snippet Override Client Default Universe Domain
@snippet google/cloud/spanner/samples/client_samples.cc set-client-universe-domain
*/
/*! @page DatabaseAdminClient-set-endpoint-snippet Override DatabaseAdminClient Default Endpoint
@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc set-client-endpoint
*/
/*! @page DatabaseAdminClient-with-service-account-snippet Override DatabaseAdminClient Default Authentication
@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc with-service-account
*/
/*! @page DatabaseAdminClient-set-universe-domain-snippet Override DatabaseAdminClient Default Universe Domain
@snippet google/cloud/spanner/admin/samples/database_admin_client_samples.cc set-client-universe-domain
*/
/*! @page InstanceAdminClient-set-endpoint-snippet Override InstanceAdminClient Default Endpoint
@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc set-client-endpoint
*/
/*! @page InstanceAdminClient-with-service-account-snippet Override InstanceAdminClient Default Authentication
@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc with-service-account
*/
/*! @page InstanceAdminClient-set-universe-domain-snippet Override InstanceAdminClient Default Universe Domain
@snippet google/cloud/spanner/admin/samples/instance_admin_client_samples.cc set-client-universe-domain
*/