google-cloud-spanner-v1 0.4.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
31
31
  value :ARRAY, 8
32
32
  value :STRUCT, 9
33
33
  value :NUMERIC, 10
34
+ value :JSON, 11
34
35
  end
35
36
  end
36
37
  end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Spanner
23
+ module V1
24
+ # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}.
25
+ # @!attribute [rw] commit_timestamp
26
+ # @return [::Google::Protobuf::Timestamp]
27
+ # The Cloud Spanner timestamp at which the transaction committed.
28
+ # @!attribute [rw] commit_stats
29
+ # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats]
30
+ # The statistics about this Commit. Not returned by default.
31
+ # For more information, see
32
+ # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}.
33
+ class CommitResponse
34
+ include ::Google::Protobuf::MessageExts
35
+ extend ::Google::Protobuf::MessageExts::ClassMethods
36
+
37
+ # Additional statistics about a commit.
38
+ # @!attribute [rw] mutation_count
39
+ # @return [::Integer]
40
+ # The total number of mutations for the transaction. Knowing the
41
+ # `mutation_count` value can help you maximize the number of mutations
42
+ # in a transaction and minimize the number of API round trips. You can
43
+ # also monitor this value to prevent transactions from exceeding the system
44
+ # [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
45
+ # If the number of mutations exceeds the limit, the server returns
46
+ # [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
47
+ class CommitStats
48
+ include ::Google::Protobuf::MessageExts
49
+ extend ::Google::Protobuf::MessageExts::ClassMethods
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -159,6 +159,68 @@ module Google
159
159
  extend ::Google::Protobuf::MessageExts::ClassMethods
160
160
  end
161
161
 
162
+ # Common request options for various APIs.
163
+ # @!attribute [rw] priority
164
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions::Priority]
165
+ # Priority for the request.
166
+ # @!attribute [rw] request_tag
167
+ # @return [::String]
168
+ # A per-request tag which can be applied to queries or reads, used for
169
+ # statistics collection.
170
+ # Both request_tag and transaction_tag can be specified for a read or query
171
+ # that belongs to a transaction.
172
+ # This field is ignored for requests where it's not applicable (e.g.
173
+ # CommitRequest).
174
+ # Legal characters for `request_tag` values are all printable characters
175
+ # (ASCII 32 - 126) and the length of a request_tag is limited to 50
176
+ # characters. Values that exceed this limit are truncated.
177
+ # @!attribute [rw] transaction_tag
178
+ # @return [::String]
179
+ # A tag used for statistics collection about this transaction.
180
+ # Both request_tag and transaction_tag can be specified for a read or query
181
+ # that belongs to a transaction.
182
+ # The value of transaction_tag should be the same for all requests belonging
183
+ # to the same transaction.
184
+ # If this request doesn’t belong to any transaction, transaction_tag will be
185
+ # ignored.
186
+ # Legal characters for `transaction_tag` values are all printable characters
187
+ # (ASCII 32 - 126) and the length of a transaction_tag is limited to 50
188
+ # characters. Values that exceed this limit are truncated.
189
+ class RequestOptions
190
+ include ::Google::Protobuf::MessageExts
191
+ extend ::Google::Protobuf::MessageExts::ClassMethods
192
+
193
+ # The relative priority for requests. Note that priority is not applicable
194
+ # for {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}.
195
+ #
196
+ # The priority acts as a hint to the Cloud Spanner scheduler and does not
197
+ # guarantee priority or order of execution. For example:
198
+ #
199
+ # * Some parts of a write operation always execute at `PRIORITY_HIGH`,
200
+ # regardless of the specified priority. This may cause you to see an
201
+ # increase in high priority workload even when executing a low priority
202
+ # request. This can also potentially cause a priority inversion where a
203
+ # lower priority request will be fulfilled ahead of a higher priority
204
+ # request.
205
+ # * If a transaction contains multiple operations with different priorities,
206
+ # Cloud Spanner does not guarantee to process the higher priority
207
+ # operations first. There may be other constraints to satisfy, such as
208
+ # order of operations.
209
+ module Priority
210
+ # `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`.
211
+ PRIORITY_UNSPECIFIED = 0
212
+
213
+ # This specifies that the request is low priority.
214
+ PRIORITY_LOW = 1
215
+
216
+ # This specifies that the request is medium priority.
217
+ PRIORITY_MEDIUM = 2
218
+
219
+ # This specifies that the request is high priority.
220
+ PRIORITY_HIGH = 3
221
+ end
222
+ end
223
+
162
224
  # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and
163
225
  # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql}.
164
226
  # @!attribute [rw] session
@@ -238,6 +300,9 @@ module Google
238
300
  # @!attribute [rw] query_options
239
301
  # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions]
240
302
  # Query optimizer configuration to use for the given query.
303
+ # @!attribute [rw] request_options
304
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions]
305
+ # Common options for this request.
241
306
  class ExecuteSqlRequest
242
307
  include ::Google::Protobuf::MessageExts
243
308
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -250,20 +315,49 @@ module Google
250
315
  # This parameter allows individual queries to pick different query
251
316
  # optimizer versions.
252
317
  #
253
- # Specifying "latest" as a value instructs Cloud Spanner to use the
318
+ # Specifying `latest` as a value instructs Cloud Spanner to use the
254
319
  # latest supported query optimizer version. If not specified, Cloud Spanner
255
- # uses optimizer version set at the database level options. Any other
320
+ # uses the optimizer version set at the database level options. Any other
256
321
  # positive integer (from the list of supported optimizer versions)
257
322
  # overrides the default optimizer version for query execution.
323
+ #
258
324
  # The list of supported optimizer versions can be queried from
259
- # SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
260
- # with an invalid optimizer version will fail with a syntax error
261
- # (`INVALID_ARGUMENT`) status.
325
+ # SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS.
326
+ #
327
+ # Executing a SQL statement with an invalid optimizer version fails with
328
+ # an `INVALID_ARGUMENT` error.
329
+ #
262
330
  # See
263
331
  # https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
264
332
  # for more information on managing the query optimizer.
265
333
  #
266
334
  # The `optimizer_version` statement hint has precedence over this setting.
335
+ # @!attribute [rw] optimizer_statistics_package
336
+ # @return [::String]
337
+ # An option to control the selection of optimizer statistics package.
338
+ #
339
+ # This parameter allows individual queries to use a different query
340
+ # optimizer statistics package.
341
+ #
342
+ # Specifying `latest` as a value instructs Cloud Spanner to use the latest
343
+ # generated statistics package. If not specified, Cloud Spanner uses
344
+ # the statistics package set at the database level options, or the latest
345
+ # package if the database option is not set.
346
+ #
347
+ # The statistics package requested by the query has to be exempt from
348
+ # garbage collection. This can be achieved with the following DDL
349
+ # statement:
350
+ #
351
+ # ```
352
+ # ALTER STATISTICS <package_name> SET OPTIONS (allow_gc=false)
353
+ # ```
354
+ #
355
+ # The list of available statistics packages can be queried from
356
+ # `INFORMATION_SCHEMA.SPANNER_STATISTICS`.
357
+ #
358
+ # Executing a SQL statement with an invalid optimizer statistics package
359
+ # or with a statistics package that allows garbage collection fails with
360
+ # an `INVALID_ARGUMENT` error.
267
361
  class QueryOptions
268
362
  include ::Google::Protobuf::MessageExts
269
363
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -322,6 +416,9 @@ module Google
322
416
  # transaction. If a request arrives for the first time with an out-of-order
323
417
  # sequence number, the transaction may be aborted. Replays of previously
324
418
  # handled requests will yield the same response as the first execution.
419
+ # @!attribute [rw] request_options
420
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions]
421
+ # Common options for this request.
325
422
  class ExecuteBatchDmlRequest
326
423
  include ::Google::Protobuf::MessageExts
327
424
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -613,6 +710,9 @@ module Google
613
710
  # previously created using PartitionRead(). There must be an exact
614
711
  # match for the values of fields common to this message and the
615
712
  # PartitionReadRequest message used to create this partition_token.
713
+ # @!attribute [rw] request_options
714
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions]
715
+ # Common options for this request.
616
716
  class ReadRequest
617
717
  include ::Google::Protobuf::MessageExts
618
718
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -625,6 +725,13 @@ module Google
625
725
  # @!attribute [rw] options
626
726
  # @return [::Google::Cloud::Spanner::V1::TransactionOptions]
627
727
  # Required. Options for the new transaction.
728
+ # @!attribute [rw] request_options
729
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions]
730
+ # Common options for this request.
731
+ # Priority is ignored for this request. Setting the priority in this
732
+ # request_options struct will not do anything. To set the priority for a
733
+ # transaction, set it on the reads and writes that are part of this
734
+ # transaction instead.
628
735
  class BeginTransactionRequest
629
736
  include ::Google::Protobuf::MessageExts
630
737
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -658,40 +765,14 @@ module Google
658
765
  # If `true`, then statistics related to the transaction will be included in
659
766
  # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. Default value is
660
767
  # `false`.
768
+ # @!attribute [rw] request_options
769
+ # @return [::Google::Cloud::Spanner::V1::RequestOptions]
770
+ # Common options for this request.
661
771
  class CommitRequest
662
772
  include ::Google::Protobuf::MessageExts
663
773
  extend ::Google::Protobuf::MessageExts::ClassMethods
664
774
  end
665
775
 
666
- # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}.
667
- # @!attribute [rw] commit_timestamp
668
- # @return [::Google::Protobuf::Timestamp]
669
- # The Cloud Spanner timestamp at which the transaction committed.
670
- # @!attribute [rw] commit_stats
671
- # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats]
672
- # The statistics about this Commit. Not returned by default.
673
- # For more information, see
674
- # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}.
675
- class CommitResponse
676
- include ::Google::Protobuf::MessageExts
677
- extend ::Google::Protobuf::MessageExts::ClassMethods
678
-
679
- # Additional statistics about a commit.
680
- # @!attribute [rw] mutation_count
681
- # @return [::Integer]
682
- # The total number of mutations for the transaction. Knowing the
683
- # `mutation_count` value can help you maximize the number of mutations
684
- # in a transaction and minimize the number of API round trips. You can
685
- # also monitor this value to prevent transactions from exceeding the system
686
- # [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
687
- # If the number of mutations exceeds the limit, the server returns
688
- # [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
689
- class CommitStats
690
- include ::Google::Protobuf::MessageExts
691
- extend ::Google::Protobuf::MessageExts::ClassMethods
692
- end
693
- end
694
-
695
776
  # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}.
696
777
  # @!attribute [rw] session
697
778
  # @return [::String]
@@ -86,7 +86,7 @@ module Google
86
86
  # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} request to abort the
87
87
  # transaction.
88
88
  #
89
- # ### Semantics
89
+ # ## Semantics
90
90
  #
91
91
  # Cloud Spanner can commit the transaction if all read locks it acquired
92
92
  # are still valid at commit time, and it is able to acquire write
@@ -99,7 +99,7 @@ module Google
99
99
  # use Cloud Spanner locks for any sort of mutual exclusion other than
100
100
  # between Cloud Spanner transactions themselves.
101
101
  #
102
- # ### Retrying Aborted Transactions
102
+ # ## Retrying Aborted Transactions
103
103
  #
104
104
  # When a transaction aborts, the application can choose to retry the
105
105
  # whole transaction again. To maximize the chances of successfully
@@ -115,7 +115,7 @@ module Google
115
115
  # instead, it is better to limit the total amount of wall time spent
116
116
  # retrying.
117
117
  #
118
- # ### Idle Transactions
118
+ # ## Idle Transactions
119
119
  #
120
120
  # A transaction is considered idle if it has no outstanding reads or
121
121
  # SQL queries and has not started a read or SQL query within the last 10
@@ -165,7 +165,7 @@ module Google
165
165
  #
166
166
  # Each type of timestamp bound is discussed in detail below.
167
167
  #
168
- # ### Strong
168
+ # ## Strong
169
169
  #
170
170
  # Strong reads are guaranteed to see the effects of all transactions
171
171
  # that have committed before the start of the read. Furthermore, all
@@ -181,7 +181,7 @@ module Google
181
181
  #
182
182
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}.
183
183
  #
184
- # ### Exact Staleness
184
+ # ## Exact Staleness
185
185
  #
186
186
  # These timestamp bounds execute reads at a user-specified
187
187
  # timestamp. Reads at a timestamp are guaranteed to see a consistent
@@ -203,7 +203,7 @@ module Google
203
203
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions.ReadOnly.read_timestamp} and
204
204
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions.ReadOnly.exact_staleness}.
205
205
  #
206
- # ### Bounded Staleness
206
+ # ## Bounded Staleness
207
207
  #
208
208
  # Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
209
209
  # subject to a user-provided staleness bound. Cloud Spanner chooses the
@@ -233,7 +233,7 @@ module Google
233
233
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions.ReadOnly.max_staleness} and
234
234
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions.ReadOnly.min_read_timestamp}.
235
235
  #
236
- # ### Old Read Timestamps and Garbage Collection
236
+ # ## Old Read Timestamps and Garbage Collection
237
237
  #
238
238
  # Cloud Spanner continuously garbage collects deleted and overwritten data
239
239
  # in the background to reclaim storage space. This process is known
@@ -131,6 +131,15 @@ module Google
131
131
  # <br>`[+-][Digits].Digits[ExponentIndicator[+-]Digits]`
132
132
  # <br>(ExponentIndicator is `"e"` or `"E"`)
133
133
  NUMERIC = 10
134
+
135
+ # Encoded as a JSON-formatted 'string' as described in RFC 7159. The
136
+ # following rules will be applied when parsing JSON input:
137
+ # - Whitespace will be stripped from the document.
138
+ # - If a JSON object has duplicate keys, only the first key will be
139
+ # preserved.
140
+ # - Members of a JSON object are not guaranteed to have their order
141
+ # preserved. JSON array elements will have their order preserved.
142
+ JSON = 11
134
143
  end
135
144
  end
136
145
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.5'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.5'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +50,14 @@ dependencies:
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: 1.24.0
53
+ version: 1.25.1
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: 1.24.0
60
+ version: 1.25.1
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: minitest
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +176,7 @@ files:
170
176
  - lib/google/cloud/spanner/v1/spanner/credentials.rb
171
177
  - lib/google/cloud/spanner/v1/spanner/paths.rb
172
178
  - lib/google/cloud/spanner/v1/version.rb
179
+ - lib/google/spanner/v1/commit_response_pb.rb
173
180
  - lib/google/spanner/v1/keys_pb.rb
174
181
  - lib/google/spanner/v1/mutation_pb.rb
175
182
  - lib/google/spanner/v1/query_plan_pb.rb
@@ -187,6 +194,7 @@ files:
187
194
  - proto_docs/google/protobuf/struct.rb
188
195
  - proto_docs/google/protobuf/timestamp.rb
189
196
  - proto_docs/google/rpc/status.rb
197
+ - proto_docs/google/spanner/v1/commit_response.rb
190
198
  - proto_docs/google/spanner/v1/keys.rb
191
199
  - proto_docs/google/spanner/v1/mutation.rb
192
200
  - proto_docs/google/spanner/v1/query_plan.rb
@@ -206,14 +214,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
214
  requirements:
207
215
  - - ">="
208
216
  - !ruby/object:Gem::Version
209
- version: '2.4'
217
+ version: '2.5'
210
218
  required_rubygems_version: !ruby/object:Gem::Requirement
211
219
  requirements:
212
220
  - - ">="
213
221
  - !ruby/object:Gem::Version
214
222
  version: '0'
215
223
  requirements: []
216
- rubygems_version: 3.2.6
224
+ rubygems_version: 3.2.17
217
225
  signing_key:
218
226
  specification_version: 4
219
227
  summary: API Client library for the Cloud Spanner V1 API