google-cloud-spanner-v1 0.2.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/spanner/v1.rb +3 -0
- data/lib/google/cloud/spanner/v1/spanner/client.rb +83 -65
- data/lib/google/cloud/spanner/v1/version.rb +1 -1
- data/lib/google/spanner/v1/spanner_pb.rb +8 -0
- data/lib/google/spanner/v1/spanner_services_pb.rb +21 -15
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/spanner/v1/spanner.rb +69 -12
- data/proto_docs/google/spanner/v1/transaction.rb +12 -11
- data/proto_docs/google/spanner/v1/type.rb +1 -1
- metadata +9 -7
@@ -54,6 +54,12 @@ module Google
|
|
54
54
|
# This indicates that the field may be set once in a request to create a
|
55
55
|
# resource, but may not be changed thereafter.
|
56
56
|
IMMUTABLE = 5
|
57
|
+
|
58
|
+
# Denotes that a (repeated) field is an unordered list.
|
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
|
61
|
+
# provided. Additionally, the list's order may or may not be stable.
|
62
|
+
UNORDERED_LIST = 6
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
@@ -43,12 +43,12 @@ module Google
|
|
43
43
|
#
|
44
44
|
# The ResourceDescriptor Yaml config will look like:
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
46
|
+
# resources:
|
47
|
+
# - type: "pubsub.googleapis.com/Topic"
|
48
|
+
# name_descriptor:
|
49
|
+
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
+
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
+
# parent_name_extractor: "projects/{project}"
|
52
52
|
#
|
53
53
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
54
|
# live under multiple parents.
|
@@ -183,15 +183,24 @@ module Google
|
|
183
183
|
# }
|
184
184
|
# @!attribute [rw] plural
|
185
185
|
# @return [::String]
|
186
|
-
# The plural name used in the resource name, such as
|
187
|
-
# the name of 'projects/\\{project}'
|
188
|
-
#
|
186
|
+
# The plural name used in the resource name and permission names, such as
|
187
|
+
# 'projects' for the resource name of 'projects/\\{project}' and the permission
|
188
|
+
# name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
|
189
|
+
# concept of the `plural` field in k8s CRD spec
|
189
190
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
191
|
+
#
|
192
|
+
# Note: The plural form is required even for singleton resources. See
|
193
|
+
# https://aip.dev/156
|
190
194
|
# @!attribute [rw] singular
|
191
195
|
# @return [::String]
|
192
196
|
# The same concept of the `singular` field in k8s CRD spec
|
193
197
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
194
198
|
# Such as "project" for the `resourcemanager.googleapis.com/Project` type.
|
199
|
+
# @!attribute [rw] style
|
200
|
+
# @return [::Array<::Google::Api::ResourceDescriptor::Style>]
|
201
|
+
# Style flag(s) for this resource.
|
202
|
+
# These indicate that a resource is expected to conform to a given
|
203
|
+
# style. See the specific style flags for additional information.
|
195
204
|
class ResourceDescriptor
|
196
205
|
include ::Google::Protobuf::MessageExts
|
197
206
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -211,6 +220,22 @@ module Google
|
|
211
220
|
# that from being necessary once there are multiple patterns.)
|
212
221
|
FUTURE_MULTI_PATTERN = 2
|
213
222
|
end
|
223
|
+
|
224
|
+
# A flag representing a specific style that a resource claims to conform to.
|
225
|
+
module Style
|
226
|
+
# The unspecified value. Do not use.
|
227
|
+
STYLE_UNSPECIFIED = 0
|
228
|
+
|
229
|
+
# This resource is intended to be "declarative-friendly".
|
230
|
+
#
|
231
|
+
# Declarative-friendly resources must be more strictly consistent, and
|
232
|
+
# setting this to true communicates to tools that this resource should
|
233
|
+
# adhere to declarative-friendly expectations.
|
234
|
+
#
|
235
|
+
# Note: This is used by the API linter (linter.aip.dev) to enable
|
236
|
+
# additional checks.
|
237
|
+
DECLARATIVE_FRIENDLY = 1
|
238
|
+
end
|
214
239
|
end
|
215
240
|
|
216
241
|
# Defines a proto annotation that describes a string field that refers to
|
@@ -226,6 +251,17 @@ module Google
|
|
226
251
|
# type: "pubsub.googleapis.com/Topic"
|
227
252
|
# }];
|
228
253
|
# }
|
254
|
+
#
|
255
|
+
# Occasionally, a field may reference an arbitrary resource. In this case,
|
256
|
+
# APIs use the special value * in their resource reference.
|
257
|
+
#
|
258
|
+
# Example:
|
259
|
+
#
|
260
|
+
# message GetIamPolicyRequest {
|
261
|
+
# string resource = 2 [(google.api.resource_reference) = {
|
262
|
+
# type: "*"
|
263
|
+
# }];
|
264
|
+
# }
|
229
265
|
# @!attribute [rw] child_type
|
230
266
|
# @return [::String]
|
231
267
|
# The resource type of a child collection that the annotated field
|
@@ -234,11 +270,11 @@ module Google
|
|
234
270
|
#
|
235
271
|
# Example:
|
236
272
|
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
273
|
+
# message ListLogEntriesRequest {
|
274
|
+
# string parent = 1 [(google.api.resource_reference) = {
|
275
|
+
# child_type: "logging.googleapis.com/LogEntry"
|
276
|
+
# };
|
277
|
+
# }
|
242
278
|
class ResourceReference
|
243
279
|
include ::Google::Protobuf::MessageExts
|
244
280
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -57,10 +57,13 @@ module Google
|
|
57
57
|
# Example 4: Pack and unpack a message in Go
|
58
58
|
#
|
59
59
|
# foo := &pb.Foo{...}
|
60
|
-
# any, err :=
|
60
|
+
# any, err := anypb.New(foo)
|
61
|
+
# if err != nil {
|
62
|
+
# ...
|
63
|
+
# }
|
61
64
|
# ...
|
62
65
|
# foo := &pb.Foo{}
|
63
|
-
# if err :=
|
66
|
+
# if err := any.UnmarshalTo(foo); err != nil {
|
64
67
|
# ...
|
65
68
|
# }
|
66
69
|
#
|
@@ -70,7 +70,16 @@ module Google
|
|
70
70
|
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
71
71
|
#
|
72
72
|
#
|
73
|
-
# Example 5: Compute Timestamp from
|
73
|
+
# Example 5: Compute Timestamp from Java `Instant.now()`.
|
74
|
+
#
|
75
|
+
# Instant now = Instant.now();
|
76
|
+
#
|
77
|
+
# Timestamp timestamp =
|
78
|
+
# Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
79
|
+
# .setNanos(now.getNano()).build();
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# Example 6: Compute Timestamp from current time in Python.
|
74
83
|
#
|
75
84
|
# timestamp = Timestamp()
|
76
85
|
# timestamp.GetCurrentTime()
|
@@ -62,10 +62,9 @@ module Google
|
|
62
62
|
end
|
63
63
|
|
64
64
|
# A session in the Cloud Spanner API.
|
65
|
-
# @!attribute [
|
65
|
+
# @!attribute [r] name
|
66
66
|
# @return [::String]
|
67
|
-
# The name of the session. This is always system-assigned
|
68
|
-
# when creating a session are ignored.
|
67
|
+
# Output only. The name of the session. This is always system-assigned.
|
69
68
|
# @!attribute [rw] labels
|
70
69
|
# @return [::Google::Protobuf::Map{::String => ::String}]
|
71
70
|
# The labels for the session.
|
@@ -77,10 +76,10 @@ module Google
|
|
77
76
|
# * No more than 64 labels can be associated with a given session.
|
78
77
|
#
|
79
78
|
# See https://goo.gl/xmQnxf for more information on and examples of labels.
|
80
|
-
# @!attribute [
|
79
|
+
# @!attribute [r] create_time
|
81
80
|
# @return [::Google::Protobuf::Timestamp]
|
82
81
|
# Output only. The timestamp when the session is created.
|
83
|
-
# @!attribute [
|
82
|
+
# @!attribute [r] approximate_last_use_time
|
84
83
|
# @return [::Google::Protobuf::Timestamp]
|
85
84
|
# Output only. The approximate timestamp when the session is last used. It is
|
86
85
|
# typically earlier than the actual last use time.
|
@@ -185,8 +184,9 @@ module Google
|
|
185
184
|
# Parameter names and values that bind to placeholders in the SQL string.
|
186
185
|
#
|
187
186
|
# A parameter placeholder consists of the `@` character followed by the
|
188
|
-
# parameter name (for example, `@firstName`). Parameter names
|
189
|
-
#
|
187
|
+
# parameter name (for example, `@firstName`). Parameter names must conform
|
188
|
+
# to the naming requirements of identifiers as specified at
|
189
|
+
# https://cloud.google.com/spanner/docs/lexical#identifiers.
|
190
190
|
#
|
191
191
|
# Parameters can appear anywhere that a literal value is expected. The same
|
192
192
|
# parameter name can be used more than once, for example:
|
@@ -250,17 +250,49 @@ module Google
|
|
250
250
|
# This parameter allows individual queries to pick different query
|
251
251
|
# optimizer versions.
|
252
252
|
#
|
253
|
-
# Specifying
|
253
|
+
# Specifying `latest` as a value instructs Cloud Spanner to use the
|
254
254
|
# latest supported query optimizer version. If not specified, Cloud Spanner
|
255
|
-
# uses optimizer version set at the database level options. Any other
|
255
|
+
# uses the optimizer version set at the database level options. Any other
|
256
256
|
# positive integer (from the list of supported optimizer versions)
|
257
257
|
# overrides the default optimizer version for query execution.
|
258
|
+
#
|
258
259
|
# The list of supported optimizer versions can be queried from
|
259
|
-
# SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS.
|
260
|
-
#
|
261
|
-
#
|
260
|
+
# SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS.
|
261
|
+
#
|
262
|
+
# Executing a SQL statement with an invalid optimizer version fails with
|
263
|
+
# an `INVALID_ARGUMENT` error.
|
264
|
+
#
|
265
|
+
# See
|
266
|
+
# https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
|
267
|
+
# for more information on managing the query optimizer.
|
262
268
|
#
|
263
269
|
# The `optimizer_version` statement hint has precedence over this setting.
|
270
|
+
# @!attribute [rw] optimizer_statistics_package
|
271
|
+
# @return [::String]
|
272
|
+
# Query optimizer statistics package to use.
|
273
|
+
#
|
274
|
+
# This parameter allows individual queries to use a different query
|
275
|
+
# optimizer statistics.
|
276
|
+
#
|
277
|
+
# Specifying `latest` as a value instructs Cloud Spanner to use the latest
|
278
|
+
# generated statistics package. If not specified, Cloud Spanner uses
|
279
|
+
# statistics package set at the database level options, or latest if
|
280
|
+
# the database option is not set.
|
281
|
+
#
|
282
|
+
# The statistics package requested by the query has to be exempt from
|
283
|
+
# garbage collection. This can be achieved with the following DDL
|
284
|
+
# statement:
|
285
|
+
#
|
286
|
+
# ```
|
287
|
+
# ALTER STATISTICS <package_name> SET OPTIONS (allow_gc=false)
|
288
|
+
# ```
|
289
|
+
#
|
290
|
+
# The list of available statistics packages can be queried from
|
291
|
+
# `SPANNER_SYS.OPTIMIZER_STATISTICS_PACKAGES`.
|
292
|
+
#
|
293
|
+
# Executing a SQL statement with an invalid optimizer statistics package
|
294
|
+
# or with statistics package that allows garbage collection fails with
|
295
|
+
# an `INVALID_ARGUMENT` error.
|
264
296
|
class QueryOptions
|
265
297
|
include ::Google::Protobuf::MessageExts
|
266
298
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -650,6 +682,11 @@ module Google
|
|
650
682
|
# The mutations to be executed when this transaction commits. All
|
651
683
|
# mutations are applied atomically, in the order they appear in
|
652
684
|
# this list.
|
685
|
+
# @!attribute [rw] return_commit_stats
|
686
|
+
# @return [::Boolean]
|
687
|
+
# If `true`, then statistics related to the transaction will be included in
|
688
|
+
# the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. Default value is
|
689
|
+
# `false`.
|
653
690
|
class CommitRequest
|
654
691
|
include ::Google::Protobuf::MessageExts
|
655
692
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -659,9 +696,29 @@ module Google
|
|
659
696
|
# @!attribute [rw] commit_timestamp
|
660
697
|
# @return [::Google::Protobuf::Timestamp]
|
661
698
|
# The Cloud Spanner timestamp at which the transaction committed.
|
699
|
+
# @!attribute [rw] commit_stats
|
700
|
+
# @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats]
|
701
|
+
# The statistics about this Commit. Not returned by default.
|
702
|
+
# For more information, see
|
703
|
+
# {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}.
|
662
704
|
class CommitResponse
|
663
705
|
include ::Google::Protobuf::MessageExts
|
664
706
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
707
|
+
|
708
|
+
# Additional statistics about a commit.
|
709
|
+
# @!attribute [rw] mutation_count
|
710
|
+
# @return [::Integer]
|
711
|
+
# The total number of mutations for the transaction. Knowing the
|
712
|
+
# `mutation_count` value can help you maximize the number of mutations
|
713
|
+
# in a transaction and minimize the number of API round trips. You can
|
714
|
+
# also monitor this value to prevent transactions from exceeding the system
|
715
|
+
# [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
|
716
|
+
# If the number of mutations exceeds the limit, the server returns
|
717
|
+
# [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
|
718
|
+
class CommitStats
|
719
|
+
include ::Google::Protobuf::MessageExts
|
720
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
721
|
+
end
|
665
722
|
end
|
666
723
|
|
667
724
|
# The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}.
|
@@ -24,10 +24,11 @@ module Google
|
|
24
24
|
# # Transactions
|
25
25
|
#
|
26
26
|
#
|
27
|
-
# Each session can have at most one active transaction at a time
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
27
|
+
# Each session can have at most one active transaction at a time (note that
|
28
|
+
# standalone reads and queries use a transaction internally and do count
|
29
|
+
# towards the one transaction limit). After the active transaction is
|
30
|
+
# completed, the session can immediately be re-used for the next transaction.
|
31
|
+
# It is not necessary to create a new session for each transaction.
|
31
32
|
#
|
32
33
|
# # Transaction Modes
|
33
34
|
#
|
@@ -85,7 +86,7 @@ module Google
|
|
85
86
|
# {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} request to abort the
|
86
87
|
# transaction.
|
87
88
|
#
|
88
|
-
#
|
89
|
+
# ## Semantics
|
89
90
|
#
|
90
91
|
# Cloud Spanner can commit the transaction if all read locks it acquired
|
91
92
|
# are still valid at commit time, and it is able to acquire write
|
@@ -98,7 +99,7 @@ module Google
|
|
98
99
|
# use Cloud Spanner locks for any sort of mutual exclusion other than
|
99
100
|
# between Cloud Spanner transactions themselves.
|
100
101
|
#
|
101
|
-
#
|
102
|
+
# ## Retrying Aborted Transactions
|
102
103
|
#
|
103
104
|
# When a transaction aborts, the application can choose to retry the
|
104
105
|
# whole transaction again. To maximize the chances of successfully
|
@@ -114,7 +115,7 @@ module Google
|
|
114
115
|
# instead, it is better to limit the total amount of wall time spent
|
115
116
|
# retrying.
|
116
117
|
#
|
117
|
-
#
|
118
|
+
# ## Idle Transactions
|
118
119
|
#
|
119
120
|
# A transaction is considered idle if it has no outstanding reads or
|
120
121
|
# SQL queries and has not started a read or SQL query within the last 10
|
@@ -164,7 +165,7 @@ module Google
|
|
164
165
|
#
|
165
166
|
# Each type of timestamp bound is discussed in detail below.
|
166
167
|
#
|
167
|
-
#
|
168
|
+
# ## Strong
|
168
169
|
#
|
169
170
|
# Strong reads are guaranteed to see the effects of all transactions
|
170
171
|
# that have committed before the start of the read. Furthermore, all
|
@@ -180,7 +181,7 @@ module Google
|
|
180
181
|
#
|
181
182
|
# See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}.
|
182
183
|
#
|
183
|
-
#
|
184
|
+
# ## Exact Staleness
|
184
185
|
#
|
185
186
|
# These timestamp bounds execute reads at a user-specified
|
186
187
|
# timestamp. Reads at a timestamp are guaranteed to see a consistent
|
@@ -202,7 +203,7 @@ module Google
|
|
202
203
|
# See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions.ReadOnly.read_timestamp} and
|
203
204
|
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions.ReadOnly.exact_staleness}.
|
204
205
|
#
|
205
|
-
#
|
206
|
+
# ## Bounded Staleness
|
206
207
|
#
|
207
208
|
# Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
|
208
209
|
# subject to a user-provided staleness bound. Cloud Spanner chooses the
|
@@ -232,7 +233,7 @@ module Google
|
|
232
233
|
# See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions.ReadOnly.max_staleness} and
|
233
234
|
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions.ReadOnly.min_read_timestamp}.
|
234
235
|
#
|
235
|
-
#
|
236
|
+
# ## Old Read Timestamps and Garbage Collection
|
236
237
|
#
|
237
238
|
# Cloud Spanner continuously garbage collects deleted and overwritten data
|
238
239
|
# in the background to reclaim storage space. This process is known
|
@@ -59,7 +59,7 @@ module Google
|
|
59
59
|
# SQL queries, it is the column alias (e.g., `"Word"` in the
|
60
60
|
# query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
|
61
61
|
# `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
|
62
|
-
# columns might have an empty name (e.g.,
|
62
|
+
# columns might have an empty name (e.g., `"SELECT
|
63
63
|
# UPPER(ColName)"`). Note that a query result can contain
|
64
64
|
# multiple fields with the same name.
|
65
65
|
# @!attribute [rw] type
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-spanner-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.25.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.25.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,9 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.9'
|
153
153
|
description: Cloud Spanner is a managed, mission-critical, globally consistent and
|
154
|
-
scalable relational database service.
|
154
|
+
scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific
|
155
|
+
client library. For most uses, we recommend installing the main client library google-cloud-spanner
|
156
|
+
instead. See the readme for more details.
|
155
157
|
email: googleapis-packages@google.com
|
156
158
|
executables: []
|
157
159
|
extensions: []
|
@@ -204,14 +206,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
206
|
requirements:
|
205
207
|
- - ">="
|
206
208
|
- !ruby/object:Gem::Version
|
207
|
-
version: '2.
|
209
|
+
version: '2.5'
|
208
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
211
|
requirements:
|
210
212
|
- - ">="
|
211
213
|
- !ruby/object:Gem::Version
|
212
214
|
version: '0'
|
213
215
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
216
|
+
rubygems_version: 3.2.13
|
215
217
|
signing_key:
|
216
218
|
specification_version: 4
|
217
219
|
summary: API Client library for the Cloud Spanner V1 API
|