google-cloud-spanner-v1 0.7.4 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b64f05386c2edb9c280625e5c53bbcf45f9fec1e2b32af526c0b9353910e4a86
4
- data.tar.gz: 2b6d4a71cbaa6981c7a1ad4f434fdda7c37e66eb0f6271c6904afb14902a0c14
3
+ metadata.gz: 107c7db85e616d72c82ff72eb07655d00ae1926f99c8002bfaf81eff4fb6caba
4
+ data.tar.gz: 42995b967b44b04c1b8effd91d090d05627cfa1df9c5ea01b1f6f9570cbefb07
5
5
  SHA512:
6
- metadata.gz: 2adb5c7f6ddabfd316314fc82150681b755ea652db640df42486dbeff625294c5f765372e783ea6964785e9860663341c665f6d5e4b8659f4bfa9b4c1c8e6cd0
7
- data.tar.gz: d6d70ca8e7bf3979068c81ce7a5c2fcb2ecf1e3d4c987785255180376f78694d0234601e0a4340a438b27933789a85ccf53445c9a40b903c2564a288390fc215
6
+ metadata.gz: a0f052167fd7a336f1566d4d9aefc9ff84e2e1b745b1c6999deae77d62900e82538943f7a25899390ddf6771ac08260ff0d1947cd10a8089eeabf73050156378
7
+ data.tar.gz: f0a3fed751f4d1af95465f51d4f94a6d423544fd28a6183b6ccfffe3ac423f2146f981b894a6600c2c8c214efa25f98828028cfa071cead7fa940bf77088fc83
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fiel
37
37
  response = client.create_session request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-spanner-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/spanner)
@@ -69,6 +69,11 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
79
  This library is supported on Ruby 2.5+.
@@ -255,7 +255,7 @@ module Google
255
255
  # @param database [::String]
256
256
  # Required. The database in which the new session is created.
257
257
  # @param session [::Google::Cloud::Spanner::V1::Session, ::Hash]
258
- # The session to create.
258
+ # Required. The session to create.
259
259
  #
260
260
  # @yield [response, operation] Access the result along with the RPC operation
261
261
  # @yieldparam response [::Google::Cloud::Spanner::V1::Session]
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- VERSION = "0.7.4"
24
+ VERSION = "0.9.0"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/spanner/v1"
29
31
  # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new
30
32
  #
@@ -1,11 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/commit_response.proto
3
3
 
4
- require 'google/protobuf/duration_pb'
5
- require 'google/protobuf/timestamp_pb'
6
- require 'google/api/annotations_pb'
7
4
  require 'google/protobuf'
8
5
 
6
+ require 'google/protobuf/timestamp_pb'
7
+
9
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
9
  add_file("google/spanner/v1/commit_response.proto", :syntax => :proto3) do
11
10
  add_message "google.spanner.v1.CommitResponse" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/keys.proto
3
3
 
4
- require 'google/protobuf/struct_pb'
5
- require 'google/api/annotations_pb'
6
4
  require 'google/protobuf'
7
5
 
6
+ require 'google/protobuf/struct_pb'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/keys.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.KeyRange" do
@@ -1,10 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/mutation.proto
3
3
 
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
4
7
  require 'google/protobuf/struct_pb'
5
8
  require 'google/spanner/v1/keys_pb'
6
- require 'google/api/annotations_pb'
7
- require 'google/protobuf'
8
9
 
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/spanner/v1/mutation.proto", :syntax => :proto3) do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/query_plan.proto
3
3
 
4
- require 'google/protobuf/struct_pb'
5
- require 'google/api/annotations_pb'
6
4
  require 'google/protobuf'
7
5
 
6
+ require 'google/protobuf/struct_pb'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/query_plan.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.PlanNode" do
@@ -1,12 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/result_set.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/protobuf/struct_pb'
5
7
  require 'google/spanner/v1/query_plan_pb'
6
8
  require 'google/spanner/v1/transaction_pb'
7
9
  require 'google/spanner/v1/type_pb'
8
- require 'google/api/annotations_pb'
9
- require 'google/protobuf'
10
10
 
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/spanner/v1/result_set.proto", :syntax => :proto3) do
@@ -1,7 +1,8 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/spanner.proto
3
3
 
4
- require 'google/spanner/v1/commit_response_pb'
4
+ require 'google/protobuf'
5
+
5
6
  require 'google/api/annotations_pb'
6
7
  require 'google/api/client_pb'
7
8
  require 'google/api/field_behavior_pb'
@@ -10,12 +11,12 @@ require 'google/protobuf/empty_pb'
10
11
  require 'google/protobuf/struct_pb'
11
12
  require 'google/protobuf/timestamp_pb'
12
13
  require 'google/rpc/status_pb'
14
+ require 'google/spanner/v1/commit_response_pb'
13
15
  require 'google/spanner/v1/keys_pb'
14
16
  require 'google/spanner/v1/mutation_pb'
15
17
  require 'google/spanner/v1/result_set_pb'
16
18
  require 'google/spanner/v1/transaction_pb'
17
19
  require 'google/spanner/v1/type_pb'
18
- require 'google/protobuf'
19
20
 
20
21
  Google::Protobuf::DescriptorPool.generated_pool.build do
21
22
  add_file("google/spanner/v1/spanner.proto", :syntax => :proto3) do
@@ -36,6 +37,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
36
37
  map :labels, :string, :string, 2
37
38
  optional :create_time, :message, 3, "google.protobuf.Timestamp"
38
39
  optional :approximate_last_use_time, :message, 4, "google.protobuf.Timestamp"
40
+ optional :creator_role, :string, 5
39
41
  end
40
42
  add_message "google.spanner.v1.GetSessionRequest" do
41
43
  optional :name, :string, 1
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/transaction.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/protobuf/duration_pb'
5
7
  require 'google/protobuf/timestamp_pb'
6
- require 'google/api/annotations_pb'
7
- require 'google/protobuf'
8
8
 
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/spanner/v1/transaction.proto", :syntax => :proto3) do
@@ -1,16 +1,17 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/type.proto
3
3
 
4
- require 'google/api/field_behavior_pb'
5
- require 'google/api/annotations_pb'
6
4
  require 'google/protobuf'
7
5
 
6
+ require 'google/api/field_behavior_pb'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/type.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.Type" do
11
11
  optional :code, :enum, 1, "google.spanner.v1.TypeCode"
12
12
  optional :array_element_type, :message, 2, "google.spanner.v1.Type"
13
13
  optional :struct_type, :message, 3, "google.spanner.v1.StructType"
14
+ optional :type_annotation, :enum, 4, "google.spanner.v1.TypeAnnotationCode"
14
15
  end
15
16
  add_message "google.spanner.v1.StructType" do
16
17
  repeated :fields, :message, 1, "google.spanner.v1.StructType.Field"
@@ -33,6 +34,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
33
34
  value :NUMERIC, 10
34
35
  value :JSON, 11
35
36
  end
37
+ add_enum "google.spanner.v1.TypeAnnotationCode" do
38
+ value :TYPE_ANNOTATION_CODE_UNSPECIFIED, 0
39
+ value :PG_NUMERIC, 2
40
+ end
36
41
  end
37
42
  end
38
43
 
@@ -44,6 +49,7 @@ module Google
44
49
  StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass
45
50
  StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass
46
51
  TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule
52
+ TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule
47
53
  end
48
54
  end
49
55
  end
@@ -44,7 +44,7 @@ module Google
44
44
  # foo = any.unpack(Foo.class);
45
45
  # }
46
46
  #
47
- # Example 3: Pack and unpack a message in Python.
47
+ # Example 3: Pack and unpack a message in Python.
48
48
  #
49
49
  # foo = Foo(...)
50
50
  # any = Any()
@@ -54,7 +54,7 @@ module Google
54
54
  # any.Unpack(foo)
55
55
  # ...
56
56
  #
57
- # Example 4: Pack and unpack a message in Go
57
+ # Example 4: Pack and unpack a message in Go
58
58
  #
59
59
  # foo := &pb.Foo{...}
60
60
  # any, err := anypb.New(foo)
@@ -75,7 +75,7 @@ module Google
75
75
  #
76
76
  #
77
77
  # JSON
78
- # ====
78
+ #
79
79
  # The JSON representation of an `Any` value uses the regular
80
80
  # representation of the deserialized, embedded message, with an
81
81
  # additional field `@type` which contains the type URL. Example:
@@ -46,8 +46,8 @@ module Google
46
46
 
47
47
  # `Value` represents a dynamically typed value which can be either
48
48
  # null, a number, a string, a boolean, a recursive struct value, or a
49
- # list of values. A producer of value is expected to set one of that
50
- # variants, absence of any variant indicates an error.
49
+ # list of values. A producer of value is expected to set one of these
50
+ # variants. Absence of any variant indicates an error.
51
51
  #
52
52
  # The JSON representation for `Value` is JSON value.
53
53
  # @!attribute [rw] null_value
@@ -41,9 +41,9 @@ module Google
41
41
  # `mutation_count` value can help you maximize the number of mutations
42
42
  # in a transaction and minimize the number of API round trips. You can
43
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).
44
+ # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
45
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).
46
+ # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
47
47
  class CommitStats
48
48
  include ::Google::Protobuf::MessageExts
49
49
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -27,7 +27,7 @@ module Google
27
27
  # Required. The database in which the new session is created.
28
28
  # @!attribute [rw] session
29
29
  # @return [::Google::Cloud::Spanner::V1::Session]
30
- # The session to create.
30
+ # Required. The session to create.
31
31
  class CreateSessionRequest
32
32
  include ::Google::Protobuf::MessageExts
33
33
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -83,6 +83,9 @@ module Google
83
83
  # @return [::Google::Protobuf::Timestamp]
84
84
  # Output only. The approximate timestamp when the session is last used. It is
85
85
  # typically earlier than the actual last use time.
86
+ # @!attribute [rw] creator_role
87
+ # @return [::String]
88
+ # The database role which created this session.
86
89
  class Session
87
90
  include ::Google::Protobuf::MessageExts
88
91
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -174,6 +177,7 @@ module Google
174
177
  # Legal characters for `request_tag` values are all printable characters
175
178
  # (ASCII 32 - 126) and the length of a request_tag is limited to 50
176
179
  # characters. Values that exceed this limit are truncated.
180
+ # Any leading underscore (_) characters will be removed from the string.
177
181
  # @!attribute [rw] transaction_tag
178
182
  # @return [::String]
179
183
  # A tag used for statistics collection about this transaction.
@@ -181,11 +185,12 @@ module Google
181
185
  # that belongs to a transaction.
182
186
  # The value of transaction_tag should be the same for all requests belonging
183
187
  # to the same transaction.
184
- # If this request doesnt belong to any transaction, transaction_tag will be
188
+ # If this request doesn't belong to any transaction, transaction_tag will be
185
189
  # ignored.
186
190
  # Legal characters for `transaction_tag` values are all printable characters
187
191
  # (ASCII 32 - 126) and the length of a transaction_tag is limited to 50
188
192
  # characters. Values that exceed this limit are truncated.
193
+ # Any leading underscore (_) characters will be removed from the string.
189
194
  class RequestOptions
190
195
  include ::Google::Protobuf::MessageExts
191
196
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -21,8 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- # # Transactions
25
- #
24
+ # Transactions:
26
25
  #
27
26
  # Each session can have at most one active transaction at a time (note that
28
27
  # standalone reads and queries use a transaction internally and do count
@@ -30,7 +29,7 @@ module Google
30
29
  # completed, the session can immediately be re-used for the next transaction.
31
30
  # It is not necessary to create a new session for each transaction.
32
31
  #
33
- # # Transaction Modes
32
+ # Transaction modes:
34
33
  #
35
34
  # Cloud Spanner supports three transaction modes:
36
35
  #
@@ -40,11 +39,18 @@ module Google
40
39
  # Locking read-write transactions may abort, requiring the
41
40
  # application to retry.
42
41
  #
43
- # 2. Snapshot read-only. This transaction type provides guaranteed
44
- # consistency across several reads, but does not allow
45
- # writes. Snapshot read-only transactions can be configured to
46
- # read at timestamps in the past. Snapshot read-only
47
- # transactions do not need to be committed.
42
+ # 2. Snapshot read-only. Snapshot read-only transactions provide guaranteed
43
+ # consistency across several reads, but do not allow
44
+ # writes. Snapshot read-only transactions can be configured to read at
45
+ # timestamps in the past, or configured to perform a strong read
46
+ # (where Spanner will select a timestamp such that the read is
47
+ # guaranteed to see the effects of all transactions that have committed
48
+ # before the start of the read). Snapshot read-only transactions do not
49
+ # need to be committed.
50
+ #
51
+ # Queries on change streams must be performed with the snapshot read-only
52
+ # transaction mode, specifying a strong read. Please see
53
+ # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong} for more details.
48
54
  #
49
55
  # 3. Partitioned DML. This type of transaction is used to execute
50
56
  # a single Partitioned DML statement. Partitioned DML partitions
@@ -59,11 +65,11 @@ module Google
59
65
  # not conflict with read-write transactions. As a consequence of not
60
66
  # taking locks, they also do not abort, so retry loops are not needed.
61
67
  #
62
- # Transactions may only read/write data in a single database. They
63
- # may, however, read/write data in different tables within that
68
+ # Transactions may only read-write data in a single database. They
69
+ # may, however, read-write data in different tables within that
64
70
  # database.
65
71
  #
66
- # ## Locking Read-Write Transactions
72
+ # Locking read-write transactions:
67
73
  #
68
74
  # Locking transactions may be used to atomically read-modify-write
69
75
  # data anywhere in a database. This type of transaction is externally
@@ -75,7 +81,7 @@ module Google
75
81
  # active as long as the transaction continues to do reads, and the
76
82
  # transaction has not been terminated by
77
83
  # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} or
78
- # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. Long periods of
84
+ # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. Long periods of
79
85
  # inactivity at the client may cause Cloud Spanner to release a
80
86
  # transaction's locks and abort it.
81
87
  #
@@ -86,7 +92,7 @@ module Google
86
92
  # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} request to abort the
87
93
  # transaction.
88
94
  #
89
- # ## Semantics
95
+ # Semantics:
90
96
  #
91
97
  # Cloud Spanner can commit the transaction if all read locks it acquired
92
98
  # are still valid at commit time, and it is able to acquire write
@@ -99,7 +105,7 @@ module Google
99
105
  # use Cloud Spanner locks for any sort of mutual exclusion other than
100
106
  # between Cloud Spanner transactions themselves.
101
107
  #
102
- # ## Retrying Aborted Transactions
108
+ # Retrying aborted transactions:
103
109
  #
104
110
  # When a transaction aborts, the application can choose to retry the
105
111
  # whole transaction again. To maximize the chances of successfully
@@ -108,26 +114,26 @@ module Google
108
114
  # priority increases with each consecutive abort, meaning that each
109
115
  # attempt has a slightly better chance of success than the previous.
110
116
  #
111
- # Under some circumstances (e.g., many transactions attempting to
117
+ # Under some circumstances (for example, many transactions attempting to
112
118
  # modify the same row(s)), a transaction can abort many times in a
113
119
  # short period before successfully committing. Thus, it is not a good
114
120
  # idea to cap the number of retries a transaction can attempt;
115
- # instead, it is better to limit the total amount of wall time spent
121
+ # instead, it is better to limit the total amount of time spent
116
122
  # retrying.
117
123
  #
118
- # ## Idle Transactions
124
+ # Idle transactions:
119
125
  #
120
126
  # A transaction is considered idle if it has no outstanding reads or
121
127
  # SQL queries and has not started a read or SQL query within the last 10
122
128
  # seconds. Idle transactions can be aborted by Cloud Spanner so that they
123
- # don't hold on to locks indefinitely. In that case, the commit will
124
- # fail with error `ABORTED`.
129
+ # don't hold on to locks indefinitely. If an idle transaction is aborted, the
130
+ # commit will fail with error `ABORTED`.
125
131
  #
126
132
  # If this behavior is undesirable, periodically executing a simple
127
- # SQL query in the transaction (e.g., `SELECT 1`) prevents the
133
+ # SQL query in the transaction (for example, `SELECT 1`) prevents the
128
134
  # transaction from becoming idle.
129
135
  #
130
- # ## Snapshot Read-Only Transactions
136
+ # Snapshot read-only transactions:
131
137
  #
132
138
  # Snapshot read-only transactions provides a simpler method than
133
139
  # locking read-write transactions for doing several consistent
@@ -160,14 +166,12 @@ module Google
160
166
  #
161
167
  # If the Cloud Spanner database to be read is geographically distributed,
162
168
  # stale read-only transactions can execute more quickly than strong
163
- # or read-write transaction, because they are able to execute far
169
+ # or read-write transactions, because they are able to execute far
164
170
  # from the leader replica.
165
171
  #
166
172
  # Each type of timestamp bound is discussed in detail below.
167
173
  #
168
- # ## Strong
169
- #
170
- # Strong reads are guaranteed to see the effects of all transactions
174
+ # Strong: Strong reads are guaranteed to see the effects of all transactions
171
175
  # that have committed before the start of the read. Furthermore, all
172
176
  # rows yielded by a single read are consistent with each other -- if
173
177
  # any part of the read observes a transaction, all parts of the read
@@ -179,15 +183,18 @@ module Google
179
183
  # reads should be executed within a transaction or at an exact read
180
184
  # timestamp.
181
185
  #
186
+ # Queries on change streams (see below for more details) must also specify
187
+ # the strong read timestamp bound.
188
+ #
182
189
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}.
183
190
  #
184
- # ## Exact Staleness
191
+ # Exact staleness:
185
192
  #
186
193
  # These timestamp bounds execute reads at a user-specified
187
194
  # timestamp. Reads at a timestamp are guaranteed to see a consistent
188
195
  # prefix of the global transaction history: they observe
189
- # modifications done by all transactions with a commit timestamp <=
190
- # the read timestamp, and observe none of the modifications done by
196
+ # modifications done by all transactions with a commit timestamp less than or
197
+ # equal to the read timestamp, and observe none of the modifications done by
191
198
  # transactions with a larger commit timestamp. They will block until
192
199
  # all conflicting transactions that may be assigned commit timestamps
193
200
  # <= the read timestamp have finished.
@@ -203,7 +210,7 @@ module Google
203
210
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions.ReadOnly.read_timestamp} and
204
211
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions.ReadOnly.exact_staleness}.
205
212
  #
206
- # ## Bounded Staleness
213
+ # Bounded staleness:
207
214
  #
208
215
  # Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
209
216
  # subject to a user-provided staleness bound. Cloud Spanner chooses the
@@ -233,7 +240,7 @@ module Google
233
240
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions.ReadOnly.max_staleness} and
234
241
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions.ReadOnly.min_read_timestamp}.
235
242
  #
236
- # ## Old Read Timestamps and Garbage Collection
243
+ # Old read timestamps and garbage collection:
237
244
  #
238
245
  # Cloud Spanner continuously garbage collects deleted and overwritten data
239
246
  # in the background to reclaim storage space. This process is known
@@ -244,7 +251,40 @@ module Google
244
251
  # timestamp become too old while executing. Reads and SQL queries with
245
252
  # too-old read timestamps fail with the error `FAILED_PRECONDITION`.
246
253
  #
247
- # ## Partitioned DML Transactions
254
+ # You can configure and extend the `VERSION_RETENTION_PERIOD` of a
255
+ # database up to a period as long as one week, which allows Cloud Spanner
256
+ # to perform reads up to one week in the past.
257
+ #
258
+ # Querying change Streams:
259
+ #
260
+ # A Change Stream is a schema object that can be configured to watch data
261
+ # changes on the entire database, a set of tables, or a set of columns
262
+ # in a database.
263
+ #
264
+ # When a change stream is created, Spanner automatically defines a
265
+ # corresponding SQL Table-Valued Function (TVF) that can be used to query
266
+ # the change records in the associated change stream using the
267
+ # ExecuteStreamingSql API. The name of the TVF for a change stream is
268
+ # generated from the name of the change stream: READ_<change_stream_name>.
269
+ #
270
+ # All queries on change stream TVFs must be executed using the
271
+ # ExecuteStreamingSql API with a single-use read-only transaction with a
272
+ # strong read-only timestamp_bound. The change stream TVF allows users to
273
+ # specify the start_timestamp and end_timestamp for the time range of
274
+ # interest. All change records within the retention period is accessible
275
+ # using the strong read-only timestamp_bound. All other TransactionOptions
276
+ # are invalid for change stream queries.
277
+ #
278
+ # In addition, if TransactionOptions.read_only.return_read_timestamp is set
279
+ # to true, a special value of 2^63 - 2 will be returned in the
280
+ # {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes the
281
+ # transaction, instead of a valid read timestamp. This special value should be
282
+ # discarded and not used for any subsequent queries.
283
+ #
284
+ # Please see https://cloud.google.com/spanner/docs/change-streams
285
+ # for more details on how to query the change stream TVFs.
286
+ #
287
+ # Partitioned DML transactions:
248
288
  #
249
289
  # Partitioned DML transactions are used to execute DML statements with a
250
290
  # different execution strategy that provides different, and often better,
@@ -34,6 +34,14 @@ module Google
34
34
  # @return [::Google::Cloud::Spanner::V1::StructType]
35
35
  # If {::Google::Cloud::Spanner::V1::Type#code code} == {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type`
36
36
  # provides type information for the struct's fields.
37
+ # @!attribute [rw] type_annotation
38
+ # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode]
39
+ # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that disambiguates SQL type that Spanner will
40
+ # use to represent values of this type during query processing. This is
41
+ # necessary for some type codes because a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped
42
+ # to different SQL types depending on the SQL dialect. {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation}
43
+ # typically is not needed to process the content of a value (it doesn't
44
+ # affect serialization) and clients can ignore it on the read path.
37
45
  class Type
38
46
  include ::Google::Protobuf::MessageExts
39
47
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -132,15 +140,34 @@ module Google
132
140
  # <br>(ExponentIndicator is `"e"` or `"E"`)
133
141
  NUMERIC = 10
134
142
 
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.
143
+ # Encoded as a JSON-formatted `string` as described in RFC 7159. The
144
+ # following rules are applied when parsing JSON input:
145
+ #
146
+ # - Whitespace characters are not preserved.
147
+ # - If a JSON object has duplicate keys, only the first key is preserved.
140
148
  # - Members of a JSON object are not guaranteed to have their order
141
- # preserved. JSON array elements will have their order preserved.
149
+ # preserved.
150
+ # - JSON array elements will have their order preserved.
142
151
  JSON = 11
143
152
  end
153
+
154
+ # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to
155
+ # disambiguate SQL types that should be used for a given Cloud Spanner value.
156
+ # Disambiguation is needed because the same Cloud Spanner type can be mapped to
157
+ # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't
158
+ # affect the way value is serialized.
159
+ module TypeAnnotationCode
160
+ # Not specified.
161
+ TYPE_ANNOTATION_CODE_UNSPECIFIED = 0
162
+
163
+ # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to
164
+ # {::Google::Cloud::Spanner::V1::Type Type} instances having {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC}
165
+ # type code to specify that values of this type should be treated as
166
+ # PostgreSQL NUMERIC values. Currently this annotation is always needed for
167
+ # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with PostgreSQL-enabled
168
+ # Spanner databases.
169
+ PG_NUMERIC = 2
170
+ end
144
171
  end
145
172
  end
146
173
  end
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.7.4
4
+ version: 0.9.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: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubygems_version: 3.3.4
224
+ rubygems_version: 3.3.14
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: API Client library for the Cloud Spanner V1 API