Debian Codegraph @

googleapis/spanner/v1/alias.go

raw
1 // Copyright 2022 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by aliasgen. DO NOT EDIT.
16
17 // Package spanner aliases all exported identifiers in package
18 // "cloud.google.com/go/spanner/apiv1/spannerpb".
19 //
20 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb.
21 // Please read https://github.com/googleapis/google-cloud-go/blob/main/migration.md
22 // for more details.
23 package spanner
24
25 import (
26 src "cloud.google.com/go/spanner/apiv1/spannerpb"
27 grpc "google.golang.org/grpc"
28 )
29
30 // Deprecated: Please use consts in: cloud.google.com/go/spanner/apiv1/spannerpb
31 const (
32 ExecuteSqlRequest_NORMAL = src.ExecuteSqlRequest_NORMAL
33 ExecuteSqlRequest_PLAN = src.ExecuteSqlRequest_PLAN
34 ExecuteSqlRequest_PROFILE = src.ExecuteSqlRequest_PROFILE
35 PlanNode_KIND_UNSPECIFIED = src.PlanNode_KIND_UNSPECIFIED
36 PlanNode_RELATIONAL = src.PlanNode_RELATIONAL
37 PlanNode_SCALAR = src.PlanNode_SCALAR
38 RequestOptions_PRIORITY_HIGH = src.RequestOptions_PRIORITY_HIGH
39 RequestOptions_PRIORITY_LOW = src.RequestOptions_PRIORITY_LOW
40 RequestOptions_PRIORITY_MEDIUM = src.RequestOptions_PRIORITY_MEDIUM
41 RequestOptions_PRIORITY_UNSPECIFIED = src.RequestOptions_PRIORITY_UNSPECIFIED
42 TransactionOptions_ReadWrite_OPTIMISTIC = src.TransactionOptions_ReadWrite_OPTIMISTIC
43 TransactionOptions_ReadWrite_PESSIMISTIC = src.TransactionOptions_ReadWrite_PESSIMISTIC
44 TransactionOptions_ReadWrite_READ_LOCK_MODE_UNSPECIFIED = src.TransactionOptions_ReadWrite_READ_LOCK_MODE_UNSPECIFIED
45 TypeAnnotationCode_PG_JSONB = src.TypeAnnotationCode_PG_JSONB
46 TypeAnnotationCode_PG_NUMERIC = src.TypeAnnotationCode_PG_NUMERIC
47 TypeAnnotationCode_TYPE_ANNOTATION_CODE_UNSPECIFIED = src.TypeAnnotationCode_TYPE_ANNOTATION_CODE_UNSPECIFIED
48 TypeCode_ARRAY = src.TypeCode_ARRAY
49 TypeCode_BOOL = src.TypeCode_BOOL
50 TypeCode_BYTES = src.TypeCode_BYTES
51 TypeCode_DATE = src.TypeCode_DATE
52 TypeCode_FLOAT64 = src.TypeCode_FLOAT64
53 TypeCode_INT64 = src.TypeCode_INT64
54 TypeCode_JSON = src.TypeCode_JSON
55 TypeCode_NUMERIC = src.TypeCode_NUMERIC
56 TypeCode_STRING = src.TypeCode_STRING
57 TypeCode_STRUCT = src.TypeCode_STRUCT
58 TypeCode_TIMESTAMP = src.TypeCode_TIMESTAMP
59 TypeCode_TYPE_CODE_UNSPECIFIED = src.TypeCode_TYPE_CODE_UNSPECIFIED
60 )
61
62 // Deprecated: Please use vars in: cloud.google.com/go/spanner/apiv1/spannerpb
63 var (
64 ExecuteSqlRequest_QueryMode_name = src.ExecuteSqlRequest_QueryMode_name
65 ExecuteSqlRequest_QueryMode_value = src.ExecuteSqlRequest_QueryMode_value
66 File_google_spanner_v1_commit_response_proto = src.File_google_spanner_v1_commit_response_proto
67 File_google_spanner_v1_keys_proto = src.File_google_spanner_v1_keys_proto
68 File_google_spanner_v1_mutation_proto = src.File_google_spanner_v1_mutation_proto
69 File_google_spanner_v1_query_plan_proto = src.File_google_spanner_v1_query_plan_proto
70 File_google_spanner_v1_result_set_proto = src.File_google_spanner_v1_result_set_proto
71 File_google_spanner_v1_spanner_proto = src.File_google_spanner_v1_spanner_proto
72 File_google_spanner_v1_transaction_proto = src.File_google_spanner_v1_transaction_proto
73 File_google_spanner_v1_type_proto = src.File_google_spanner_v1_type_proto
74 PlanNode_Kind_name = src.PlanNode_Kind_name
75 PlanNode_Kind_value = src.PlanNode_Kind_value
76 RequestOptions_Priority_name = src.RequestOptions_Priority_name
77 RequestOptions_Priority_value = src.RequestOptions_Priority_value
78 TransactionOptions_ReadWrite_ReadLockMode_name = src.TransactionOptions_ReadWrite_ReadLockMode_name
79 TransactionOptions_ReadWrite_ReadLockMode_value = src.TransactionOptions_ReadWrite_ReadLockMode_value
80 TypeAnnotationCode_name = src.TypeAnnotationCode_name
81 TypeAnnotationCode_value = src.TypeAnnotationCode_value
82 TypeCode_name = src.TypeCode_name
83 TypeCode_value = src.TypeCode_value
84 )
85
86 // The request for
87 // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
88 //
89 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
90 type BatchCreateSessionsRequest = src.BatchCreateSessionsRequest
91
92 // The response for
93 // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
94 //
95 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
96 type BatchCreateSessionsResponse = src.BatchCreateSessionsResponse
97
98 // The request for
99 // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction].
100 //
101 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
102 type BeginTransactionRequest = src.BeginTransactionRequest
103
104 // The request for [Commit][google.spanner.v1.Spanner.Commit].
105 //
106 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
107 type CommitRequest = src.CommitRequest
108 type CommitRequest_SingleUseTransaction = src.CommitRequest_SingleUseTransaction
109 type CommitRequest_TransactionId = src.CommitRequest_TransactionId
110
111 // The response for [Commit][google.spanner.v1.Spanner.Commit].
112 //
113 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
114 type CommitResponse = src.CommitResponse
115
116 // Additional statistics about a commit.
117 //
118 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
119 type CommitResponse_CommitStats = src.CommitResponse_CommitStats
120
121 // The request for [CreateSession][google.spanner.v1.Spanner.CreateSession].
122 //
123 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
124 type CreateSessionRequest = src.CreateSessionRequest
125
126 // The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession].
127 //
128 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
129 type DeleteSessionRequest = src.DeleteSessionRequest
130
131 // The request for
132 // [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
133 //
134 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
135 type ExecuteBatchDmlRequest = src.ExecuteBatchDmlRequest
136
137 // A single DML statement.
138 //
139 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
140 type ExecuteBatchDmlRequest_Statement = src.ExecuteBatchDmlRequest_Statement
141
142 // The response for
143 // [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a
144 // list of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML
145 // statement that has successfully executed, in the same order as the
146 // statements in the request. If a statement fails, the status in the response
147 // body identifies the cause of the failure. To check for DML statements that
148 // failed, use the following approach: 1. Check the status in the response
149 // message. The [google.rpc.Code][google.rpc.Code] enum value `OK` indicates
150 // that all statements were executed successfully. 2. If the status was not
151 // `OK`, check the number of result sets in the response. If the response
152 // contains `N` [ResultSet][google.spanner.v1.ResultSet] messages, then
153 // statement `N+1` in the request failed. Example 1: * Request: 5 DML
154 // statements, all executed successfully. * Response: 5
155 // [ResultSet][google.spanner.v1.ResultSet] messages, with the status `OK`.
156 // Example 2: - Request: 5 DML statements. The third statement has a syntax
157 // error. - Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and
158 // a syntax error (`INVALID_ARGUMENT`) status. The number of
159 // [ResultSet][google.spanner.v1.ResultSet] messages indicates that the third
160 // statement failed, and the fourth and fifth statements were not executed.
161 //
162 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
163 type ExecuteBatchDmlResponse = src.ExecuteBatchDmlResponse
164
165 // The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
166 // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql].
167 //
168 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
169 type ExecuteSqlRequest = src.ExecuteSqlRequest
170
171 // Mode in which the statement must be processed.
172 //
173 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
174 type ExecuteSqlRequest_QueryMode = src.ExecuteSqlRequest_QueryMode
175
176 // Query optimizer configuration.
177 //
178 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
179 type ExecuteSqlRequest_QueryOptions = src.ExecuteSqlRequest_QueryOptions
180
181 // The request for [GetSession][google.spanner.v1.Spanner.GetSession].
182 //
183 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
184 type GetSessionRequest = src.GetSessionRequest
185
186 // KeyRange represents a range of rows in a table or index. A range has a
187 // start key and an end key. These keys can be open or closed, indicating if
188 // the range includes rows with that key. Keys are represented by lists, where
189 // the ith value in the list corresponds to the ith component of the table or
190 // index primary key. Individual values are encoded as described
191 // [here][google.spanner.v1.TypeCode]. For example, consider the following
192 // table definition: CREATE TABLE UserEvents ( UserName STRING(MAX), EventDate
193 // STRING(10) ) PRIMARY KEY(UserName, EventDate); The following keys name rows
194 // in this table: ["Bob", "2014-09-23"] ["Alfred", "2015-06-12"] Since the
195 // `UserEvents` table's `PRIMARY KEY` clause names two columns, each
196 // `UserEvents` key has two elements; the first is the `UserName`, and the
197 // second is the `EventDate`. Key ranges with multiple components are
198 // interpreted lexicographically by component using the table or index key's
199 // declared sort order. For example, the following range returns all events for
200 // user `"Bob"` that occurred in the year 2015: "start_closed": ["Bob",
201 // "2015-01-01"] "end_closed": ["Bob", "2015-12-31"] Start and end keys can
202 // omit trailing key components. This affects the inclusion and exclusion of
203 // rows that exactly match the provided key components: if the key is closed,
204 // then rows that exactly match the provided components are included; if the
205 // key is open, then rows that exactly match are not included. For example, the
206 // following range includes all events for `"Bob"` that occurred during and
207 // after the year 2000: "start_closed": ["Bob", "2000-01-01"] "end_closed":
208 // ["Bob"] The next example retrieves all events for `"Bob"`: "start_closed":
209 // ["Bob"] "end_closed": ["Bob"] To retrieve events before the year 2000:
210 // "start_closed": ["Bob"] "end_open": ["Bob", "2000-01-01"] The following
211 // range includes all rows in the table: "start_closed": [] "end_closed": []
212 // This range returns all users whose `UserName` begins with any character from
213 // A to C: "start_closed": ["A"] "end_open": ["D"] This range returns all users
214 // whose `UserName` begins with B: "start_closed": ["B"] "end_open": ["C"] Key
215 // ranges honor column sort order. For example, suppose a table is defined as
216 // follows: CREATE TABLE DescendingSortedTable { Key INT64, ... ) PRIMARY
217 // KEY(Key DESC); The following range retrieves all rows with key values
218 // between 1 and 100 inclusive: "start_closed": ["100"] "end_closed": ["1"]
219 // Note that 100 is passed as the start, and 1 is passed as the end, because
220 // `Key` is a descending column in the schema.
221 //
222 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
223 type KeyRange = src.KeyRange
224 type KeyRange_EndClosed = src.KeyRange_EndClosed
225 type KeyRange_EndOpen = src.KeyRange_EndOpen
226 type KeyRange_StartClosed = src.KeyRange_StartClosed
227 type KeyRange_StartOpen = src.KeyRange_StartOpen
228
229 // `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All
230 // the keys are expected to be in the same table or index. The keys need not be
231 // sorted in any particular way. If the same key is specified multiple times in
232 // the set (for example if two ranges, two keys, or a key and a range overlap),
233 // Cloud Spanner behaves as if the key were only specified once.
234 //
235 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
236 type KeySet = src.KeySet
237
238 // The request for [ListSessions][google.spanner.v1.Spanner.ListSessions].
239 //
240 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
241 type ListSessionsRequest = src.ListSessionsRequest
242
243 // The response for [ListSessions][google.spanner.v1.Spanner.ListSessions].
244 //
245 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
246 type ListSessionsResponse = src.ListSessionsResponse
247
248 // A modification to one or more Cloud Spanner rows. Mutations can be applied
249 // to a Cloud Spanner database by sending them in a
250 // [Commit][google.spanner.v1.Spanner.Commit] call.
251 //
252 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
253 type Mutation = src.Mutation
254
255 // Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
256 //
257 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
258 type Mutation_Delete = src.Mutation_Delete
259 type Mutation_Delete_ = src.Mutation_Delete_
260 type Mutation_Insert = src.Mutation_Insert
261 type Mutation_InsertOrUpdate = src.Mutation_InsertOrUpdate
262 type Mutation_Replace = src.Mutation_Replace
263 type Mutation_Update = src.Mutation_Update
264
265 // Arguments to [insert][google.spanner.v1.Mutation.insert],
266 // [update][google.spanner.v1.Mutation.update],
267 // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and
268 // [replace][google.spanner.v1.Mutation.replace] operations.
269 //
270 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
271 type Mutation_Write = src.Mutation_Write
272
273 // Partial results from a streaming read or SQL query. Streaming reads and SQL
274 // queries better tolerate large result sets, large rows, and large values, but
275 // are a little trickier to consume.
276 //
277 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
278 type PartialResultSet = src.PartialResultSet
279
280 // Information returned for each partition returned in a PartitionResponse.
281 //
282 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
283 type Partition = src.Partition
284
285 // Options for a PartitionQueryRequest and PartitionReadRequest.
286 //
287 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
288 type PartitionOptions = src.PartitionOptions
289
290 // The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery]
291 //
292 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
293 type PartitionQueryRequest = src.PartitionQueryRequest
294
295 // The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead]
296 //
297 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
298 type PartitionReadRequest = src.PartitionReadRequest
299
300 // The response for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery]
301 // or [PartitionRead][google.spanner.v1.Spanner.PartitionRead]
302 //
303 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
304 type PartitionResponse = src.PartitionResponse
305
306 // Node information for nodes appearing in a
307 // [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
308 //
309 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
310 type PlanNode = src.PlanNode
311
312 // Metadata associated with a parent-child relationship appearing in a
313 // [PlanNode][google.spanner.v1.PlanNode].
314 //
315 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
316 type PlanNode_ChildLink = src.PlanNode_ChildLink
317
318 // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between
319 // the two different kinds of nodes that can appear in a query plan.
320 //
321 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
322 type PlanNode_Kind = src.PlanNode_Kind
323
324 // Condensed representation of a node and its subtree. Only present for
325 // `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode].
326 //
327 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
328 type PlanNode_ShortRepresentation = src.PlanNode_ShortRepresentation
329
330 // Contains an ordered list of nodes appearing in the query plan.
331 //
332 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
333 type QueryPlan = src.QueryPlan
334
335 // The request for [Read][google.spanner.v1.Spanner.Read] and
336 // [StreamingRead][google.spanner.v1.Spanner.StreamingRead].
337 //
338 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
339 type ReadRequest = src.ReadRequest
340
341 // Common request options for various APIs.
342 //
343 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
344 type RequestOptions = src.RequestOptions
345
346 // The relative priority for requests. Note that priority is not applicable
347 // for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. The
348 // priority acts as a hint to the Cloud Spanner scheduler and does not
349 // guarantee priority or order of execution. For example: - Some parts of a
350 // write operation always execute at `PRIORITY_HIGH`, regardless of the
351 // specified priority. This may cause you to see an increase in high priority
352 // workload even when executing a low priority request. This can also
353 // potentially cause a priority inversion where a lower priority request will
354 // be fulfilled ahead of a higher priority request. - If a transaction contains
355 // multiple operations with different priorities, Cloud Spanner does not
356 // guarantee to process the higher priority operations first. There may be
357 // other constraints to satisfy, such as order of operations.
358 //
359 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
360 type RequestOptions_Priority = src.RequestOptions_Priority
361
362 // Results from [Read][google.spanner.v1.Spanner.Read] or
363 // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
364 //
365 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
366 type ResultSet = src.ResultSet
367
368 // Metadata about a [ResultSet][google.spanner.v1.ResultSet] or
369 // [PartialResultSet][google.spanner.v1.PartialResultSet].
370 //
371 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
372 type ResultSetMetadata = src.ResultSetMetadata
373
374 // Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or
375 // [PartialResultSet][google.spanner.v1.PartialResultSet].
376 //
377 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
378 type ResultSetStats = src.ResultSetStats
379 type ResultSetStats_RowCountExact = src.ResultSetStats_RowCountExact
380 type ResultSetStats_RowCountLowerBound = src.ResultSetStats_RowCountLowerBound
381
382 // The request for [Rollback][google.spanner.v1.Spanner.Rollback].
383 //
384 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
385 type RollbackRequest = src.RollbackRequest
386
387 // A session in the Cloud Spanner API.
388 //
389 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
390 type Session = src.Session
391
392 // SpannerClient is the client API for Spanner service. For semantics around
393 // ctx use and closing/ending streaming RPCs, please refer to
394 // https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
395 //
396 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
397 type SpannerClient = src.SpannerClient
398
399 // SpannerServer is the server API for Spanner service.
400 //
401 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
402 type SpannerServer = src.SpannerServer
403 type Spanner_ExecuteStreamingSqlClient = src.Spanner_ExecuteStreamingSqlClient
404 type Spanner_ExecuteStreamingSqlServer = src.Spanner_ExecuteStreamingSqlServer
405 type Spanner_StreamingReadClient = src.Spanner_StreamingReadClient
406 type Spanner_StreamingReadServer = src.Spanner_StreamingReadServer
407
408 // `StructType` defines the fields of a
409 // [STRUCT][google.spanner.v1.TypeCode.STRUCT] type.
410 //
411 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
412 type StructType = src.StructType
413
414 // Message representing a single field of a struct.
415 //
416 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
417 type StructType_Field = src.StructType_Field
418
419 // A transaction.
420 //
421 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
422 type Transaction = src.Transaction
423
424 // Transactions: Each session can have at most one active transaction at a
425 // time (note that standalone reads and queries use a transaction internally
426 // and do count towards the one transaction limit). After the active
427 // transaction is completed, the session can immediately be re-used for the
428 // next transaction. It is not necessary to create a new session for each
429 // transaction. Transaction modes: Cloud Spanner supports three transaction
430 // modes: 1. Locking read-write. This type of transaction is the only way to
431 // write data into Cloud Spanner. These transactions rely on pessimistic
432 // locking and, if necessary, two-phase commit. Locking read-write transactions
433 // may abort, requiring the application to retry. 2. Snapshot read-only.
434 // Snapshot read-only transactions provide guaranteed consistency across
435 // several reads, but do not allow writes. Snapshot read-only transactions can
436 // be configured to read at timestamps in the past, or configured to perform a
437 // strong read (where Spanner will select a timestamp such that the read is
438 // guaranteed to see the effects of all transactions that have committed before
439 // the start of the read). Snapshot read-only transactions do not need to be
440 // committed. Queries on change streams must be performed with the snapshot
441 // read-only transaction mode, specifying a strong read. Please see
442 // [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong]
443 // for more details. 3. Partitioned DML. This type of transaction is used to
444 // execute a single Partitioned DML statement. Partitioned DML partitions the
445 // key space and runs the DML statement over each partition in parallel using
446 // separate, internal transactions that commit independently. Partitioned DML
447 // transactions do not need to be committed. For transactions that only read,
448 // snapshot read-only transactions provide simpler semantics and are almost
449 // always faster. In particular, read-only transactions do not take locks, so
450 // they do not conflict with read-write transactions. As a consequence of not
451 // taking locks, they also do not abort, so retry loops are not needed.
452 // Transactions may only read-write data in a single database. They may,
453 // however, read-write data in different tables within that database. Locking
454 // read-write transactions: Locking transactions may be used to atomically
455 // read-modify-write data anywhere in a database. This type of transaction is
456 // externally consistent. Clients should attempt to minimize the amount of time
457 // a transaction is active. Faster transactions commit with higher probability
458 // and cause less contention. Cloud Spanner attempts to keep read locks active
459 // as long as the transaction continues to do reads, and the transaction has
460 // not been terminated by [Commit][google.spanner.v1.Spanner.Commit] or
461 // [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of inactivity
462 // at the client may cause Cloud Spanner to release a transaction's locks and
463 // abort it. Conceptually, a read-write transaction consists of zero or more
464 // reads or SQL statements followed by
465 // [Commit][google.spanner.v1.Spanner.Commit]. At any time before
466 // [Commit][google.spanner.v1.Spanner.Commit], the client can send a
467 // [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the
468 // transaction. Semantics: Cloud Spanner can commit the transaction if all read
469 // locks it acquired are still valid at commit time, and it is able to acquire
470 // write locks for all writes. Cloud Spanner can abort the transaction for any
471 // reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees that
472 // the transaction has not modified any user data in Cloud Spanner. Unless the
473 // transaction commits, Cloud Spanner makes no guarantees about how long the
474 // transaction's locks were held for. It is an error to use Cloud Spanner locks
475 // for any sort of mutual exclusion other than between Cloud Spanner
476 // transactions themselves. Retrying aborted transactions: When a transaction
477 // aborts, the application can choose to retry the whole transaction again. To
478 // maximize the chances of successfully committing the retry, the client should
479 // execute the retry in the same session as the original attempt. The original
480 // session's lock priority increases with each consecutive abort, meaning that
481 // each attempt has a slightly better chance of success than the previous.
482 // Under some circumstances (for example, many transactions attempting to
483 // modify the same row(s)), a transaction can abort many times in a short
484 // period before successfully committing. Thus, it is not a good idea to cap
485 // the number of retries a transaction can attempt; instead, it is better to
486 // limit the total amount of time spent retrying. Idle transactions: A
487 // transaction is considered idle if it has no outstanding reads or SQL queries
488 // and has not started a read or SQL query within the last 10 seconds. Idle
489 // transactions can be aborted by Cloud Spanner so that they don't hold on to
490 // locks indefinitely. If an idle transaction is aborted, the commit will fail
491 // with error `ABORTED`. If this behavior is undesirable, periodically
492 // executing a simple SQL query in the transaction (for example, `SELECT 1`)
493 // prevents the transaction from becoming idle. Snapshot read-only
494 // transactions: Snapshot read-only transactions provides a simpler method than
495 // locking read-write transactions for doing several consistent reads. However,
496 // this type of transaction does not support writes. Snapshot transactions do
497 // not take locks. Instead, they work by choosing a Cloud Spanner timestamp,
498 // then executing all reads at that timestamp. Since they do not acquire locks,
499 // they do not block concurrent read-write transactions. Unlike locking
500 // read-write transactions, snapshot read-only transactions never abort. They
501 // can fail if the chosen read timestamp is garbage collected; however, the
502 // default garbage collection policy is generous enough that most applications
503 // do not need to worry about this in practice. Snapshot read-only transactions
504 // do not need to call [Commit][google.spanner.v1.Spanner.Commit] or
505 // [Rollback][google.spanner.v1.Spanner.Rollback] (and in fact are not
506 // permitted to do so). To execute a snapshot transaction, the client specifies
507 // a timestamp bound, which tells Cloud Spanner how to choose a read timestamp.
508 // The types of timestamp bound are: - Strong (the default). - Bounded
509 // staleness. - Exact staleness. If the Cloud Spanner database to be read is
510 // geographically distributed, stale read-only transactions can execute more
511 // quickly than strong or read-write transactions, because they are able to
512 // execute far from the leader replica. Each type of timestamp bound is
513 // discussed in detail below. Strong: Strong reads are guaranteed to see the
514 // effects of all transactions that have committed before the start of the
515 // read. Furthermore, all rows yielded by a single read are consistent with
516 // each other -- if any part of the read observes a transaction, all parts of
517 // the read see the transaction. Strong reads are not repeatable: two
518 // consecutive strong read-only transactions might return inconsistent results
519 // if there are concurrent writes. If consistency across reads is required, the
520 // reads should be executed within a transaction or at an exact read timestamp.
521 // Queries on change streams (see below for more details) must also specify the
522 // strong read timestamp bound. See
523 // [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong].
524 // Exact staleness: These timestamp bounds execute reads at a user-specified
525 // timestamp. Reads at a timestamp are guaranteed to see a consistent prefix of
526 // the global transaction history: they observe modifications done by all
527 // transactions with a commit timestamp less than or equal to the read
528 // timestamp, and observe none of the modifications done by transactions with a
529 // larger commit timestamp. They will block until all conflicting transactions
530 // that may be assigned commit timestamps <= the read timestamp have finished.
531 // The timestamp can either be expressed as an absolute Cloud Spanner commit
532 // timestamp or a staleness relative to the current time. These modes do not
533 // require a "negotiation phase" to pick a timestamp. As a result, they execute
534 // slightly faster than the equivalent boundedly stale concurrency modes. On
535 // the other hand, boundedly stale reads usually return fresher results. See
536 // [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp]
537 // and
538 // [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness].
539 // Bounded staleness: Bounded staleness modes allow Cloud Spanner to pick the
540 // read timestamp, subject to a user-provided staleness bound. Cloud Spanner
541 // chooses the newest timestamp within the staleness bound that allows
542 // execution of the reads at the closest available replica without blocking.
543 // All rows yielded are consistent with each other -- if any part of the read
544 // observes a transaction, all parts of the read see the transaction. Boundedly
545 // stale reads are not repeatable: two stale reads, even if they use the same
546 // staleness bound, can execute at different timestamps and thus return
547 // inconsistent results. Boundedly stale reads execute in two phases: the first
548 // phase negotiates a timestamp among all replicas needed to serve the read. In
549 // the second phase, reads are executed at the negotiated timestamp. As a
550 // result of the two phase execution, bounded staleness reads are usually a
551 // little slower than comparable exact staleness reads. However, they are
552 // typically able to return fresher results, and are more likely to execute at
553 // the closest replica. Because the timestamp negotiation requires up-front
554 // knowledge of which rows will be read, it can only be used with single-use
555 // read-only transactions. See
556 // [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness]
557 // and
558 // [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp].
559 // Old read timestamps and garbage collection: Cloud Spanner continuously
560 // garbage collects deleted and overwritten data in the background to reclaim
561 // storage space. This process is known as "version GC". By default, version GC
562 // reclaims versions after they are one hour old. Because of this, Cloud
563 // Spanner cannot perform reads at read timestamps more than one hour in the
564 // past. This restriction also applies to in-progress reads and/or SQL queries
565 // whose timestamp become too old while executing. Reads and SQL queries with
566 // too-old read timestamps fail with the error `FAILED_PRECONDITION`. You can
567 // configure and extend the `VERSION_RETENTION_PERIOD` of a database up to a
568 // period as long as one week, which allows Cloud Spanner to perform reads up
569 // to one week in the past. Querying change Streams: A Change Stream is a
570 // schema object that can be configured to watch data changes on the entire
571 // database, a set of tables, or a set of columns in a database. When a change
572 // stream is created, Spanner automatically defines a corresponding SQL
573 // Table-Valued Function (TVF) that can be used to query the change records in
574 // the associated change stream using the ExecuteStreamingSql API. The name of
575 // the TVF for a change stream is generated from the name of the change stream:
576 // READ_<change_stream_name>. All queries on change stream TVFs must be
577 // executed using the ExecuteStreamingSql API with a single-use read-only
578 // transaction with a strong read-only timestamp_bound. The change stream TVF
579 // allows users to specify the start_timestamp and end_timestamp for the time
580 // range of interest. All change records within the retention period is
581 // accessible using the strong read-only timestamp_bound. All other
582 // TransactionOptions are invalid for change stream queries. In addition, if
583 // TransactionOptions.read_only.return_read_timestamp is set to true, a special
584 // value of 2^63 - 2 will be returned in the
585 // [Transaction][google.spanner.v1.Transaction] message that describes the
586 // transaction, instead of a valid read timestamp. This special value should be
587 // discarded and not used for any subsequent queries. Please see
588 // https://cloud.google.com/spanner/docs/change-streams for more details on how
589 // to query the change stream TVFs. Partitioned DML transactions: Partitioned
590 // DML transactions are used to execute DML statements with a different
591 // execution strategy that provides different, and often better, scalability
592 // properties for large, table-wide operations than DML in a ReadWrite
593 // transaction. Smaller scoped statements, such as an OLTP workload, should
594 // prefer using ReadWrite transactions. Partitioned DML partitions the keyspace
595 // and runs the DML statement on each partition in separate, internal
596 // transactions. These transactions commit automatically when complete, and run
597 // independently from one another. To reduce lock contention, this execution
598 // strategy only acquires read locks on rows that match the WHERE clause of the
599 // statement. Additionally, the smaller per-partition transactions hold locks
600 // for less time. That said, Partitioned DML is not a drop-in replacement for
601 // standard DML used in ReadWrite transactions. - The DML statement must be
602 // fully-partitionable. Specifically, the statement must be expressible as the
603 // union of many statements which each access only a single row of the table. -
604 // The statement is not applied atomically to all rows of the table. Rather,
605 // the statement is applied atomically to partitions of the table, in
606 // independent transactions. Secondary index rows are updated atomically with
607 // the base table rows. - Partitioned DML does not guarantee exactly-once
608 // execution semantics against a partition. The statement will be applied at
609 // least once to each partition. It is strongly recommended that the DML
610 // statement should be idempotent to avoid unexpected results. For instance, it
611 // is potentially dangerous to run a statement such as `UPDATE table SET column
612 // = column + 1` as it could be run multiple times against some rows. - The
613 // partitions are committed automatically - there is no support for Commit or
614 // Rollback. If the call returns an error, or if the client issuing the
615 // ExecuteSql call dies, it is possible that some rows had the statement
616 // executed on them successfully. It is also possible that statement was never
617 // executed against other rows. - Partitioned DML transactions may only contain
618 // the execution of a single DML statement via ExecuteSql or
619 // ExecuteStreamingSql. - If any error is encountered during the execution of
620 // the partitioned DML operation (for instance, a UNIQUE INDEX violation,
621 // division by zero, or a value that cannot be stored due to schema
622 // constraints), then the operation is stopped at that point and an error is
623 // returned. It is possible that at this point, some partitions have been
624 // committed (or even committed multiple times), and other partitions have not
625 // been run at all. Given the above, Partitioned DML is good fit for large,
626 // database-wide, operations that are idempotent, such as deleting old rows
627 // from a very large table.
628 //
629 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
630 type TransactionOptions = src.TransactionOptions
631
632 // Message type to initiate a Partitioned DML transaction.
633 //
634 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
635 type TransactionOptions_PartitionedDml = src.TransactionOptions_PartitionedDml
636 type TransactionOptions_PartitionedDml_ = src.TransactionOptions_PartitionedDml_
637
638 // Message type to initiate a read-only transaction.
639 //
640 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
641 type TransactionOptions_ReadOnly = src.TransactionOptions_ReadOnly
642 type TransactionOptions_ReadOnly_ = src.TransactionOptions_ReadOnly_
643 type TransactionOptions_ReadOnly_ExactStaleness = src.TransactionOptions_ReadOnly_ExactStaleness
644 type TransactionOptions_ReadOnly_MaxStaleness = src.TransactionOptions_ReadOnly_MaxStaleness
645 type TransactionOptions_ReadOnly_MinReadTimestamp = src.TransactionOptions_ReadOnly_MinReadTimestamp
646 type TransactionOptions_ReadOnly_ReadTimestamp = src.TransactionOptions_ReadOnly_ReadTimestamp
647 type TransactionOptions_ReadOnly_Strong = src.TransactionOptions_ReadOnly_Strong
648
649 // Message type to initiate a read-write transaction. Currently this
650 // transaction type has no options.
651 //
652 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
653 type TransactionOptions_ReadWrite = src.TransactionOptions_ReadWrite
654 type TransactionOptions_ReadWrite_ = src.TransactionOptions_ReadWrite_
655
656 // `ReadLockMode` is used to set the read lock mode for read-write
657 // transactions.
658 //
659 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
660 type TransactionOptions_ReadWrite_ReadLockMode = src.TransactionOptions_ReadWrite_ReadLockMode
661
662 // This message is used to select the transaction in which a
663 // [Read][google.spanner.v1.Spanner.Read] or
664 // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. See
665 // [TransactionOptions][google.spanner.v1.TransactionOptions] for more
666 // information about transactions.
667 //
668 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
669 type TransactionSelector = src.TransactionSelector
670 type TransactionSelector_Begin = src.TransactionSelector_Begin
671 type TransactionSelector_Id = src.TransactionSelector_Id
672 type TransactionSelector_SingleUse = src.TransactionSelector_SingleUse
673
674 // `Type` indicates the type of a Cloud Spanner value, as might be stored in a
675 // table cell or returned from an SQL query.
676 //
677 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
678 type Type = src.Type
679
680 // `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to
681 // disambiguate SQL types that should be used for a given Cloud Spanner value.
682 // Disambiguation is needed because the same Cloud Spanner type can be mapped
683 // to different SQL types depending on SQL dialect. TypeAnnotationCode doesn't
684 // affect the way value is serialized.
685 //
686 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
687 type TypeAnnotationCode = src.TypeAnnotationCode
688
689 // `TypeCode` is used as part of [Type][google.spanner.v1.Type] to indicate
690 // the type of a Cloud Spanner value. Each legal value of a type can be encoded
691 // to or decoded from a JSON value, using the encodings described below. All
692 // Cloud Spanner values can be `null`, regardless of type; `null`s are always
693 // encoded as a JSON `null`.
694 //
695 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
696 type TypeCode = src.TypeCode
697
698 // UnimplementedSpannerServer can be embedded to have forward compatible
699 // implementations.
700 //
701 // Deprecated: Please use types in: cloud.google.com/go/spanner/apiv1/spannerpb
702 type UnimplementedSpannerServer = src.UnimplementedSpannerServer
703
704 // Deprecated: Please use funcs in: cloud.google.com/go/spanner/apiv1/spannerpb
705 func NewSpannerClient(cc grpc.ClientConnInterface) SpannerClient { return src.NewSpannerClient(cc) }
706
707 // Deprecated: Please use funcs in: cloud.google.com/go/spanner/apiv1/spannerpb
708 func RegisterSpannerServer(s *grpc.Server, srv SpannerServer) { src.RegisterSpannerServer(s, srv) }