google-cloud-spanner-v1 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/spanner/v1/spanner/client.rb +17 -5
- data/lib/google/cloud/spanner/v1/version.rb +1 -1
- data/lib/google/spanner/v1/spanner_pb.rb +7 -0
- data/lib/google/spanner/v1/spanner_services_pb.rb +6 -0
- data/proto_docs/google/spanner/v1/spanner.rb +35 -7
- data/proto_docs/google/spanner/v1/transaction.rb +5 -4
- data/proto_docs/google/spanner/v1/type.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc249a88987a01cb292039eff91ea84e35fccdc84015c7c84cdcbd34858178c
|
4
|
+
data.tar.gz: 5d899e990abc7f2b9a87913116e9cdccc367f544e50aef6b9e9bc125226b34a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edcff63203e85d4d5d641ac7fb8dbc122d46ee661026054aa970bc9059fa41ccce7fccc277f8e257e19ed4cde8bf3fc23118915de6e5c21d708af634ffd9d236
|
7
|
+
data.tar.gz: ca00243b49bdb011daff75922cd1b150acca227e4f1dfe0686cffdfc19ddc6dda8b2702e424ef1c15d3269b20859a5278d42c00402c072610e2f29baf4b3b8ec
|
@@ -686,8 +686,9 @@ module Google
|
|
686
686
|
# Parameter names and values that bind to placeholders in the SQL string.
|
687
687
|
#
|
688
688
|
# A parameter placeholder consists of the `@` character followed by the
|
689
|
-
# parameter name (for example, `@firstName`). Parameter names
|
690
|
-
#
|
689
|
+
# parameter name (for example, `@firstName`). Parameter names must conform
|
690
|
+
# to the naming requirements of identifiers as specified at
|
691
|
+
# https://cloud.google.com/spanner/docs/lexical#identifiers.
|
691
692
|
#
|
692
693
|
# Parameters can appear anywhere that a literal value is expected. The same
|
693
694
|
# parameter name can be used more than once, for example:
|
@@ -820,8 +821,9 @@ module Google
|
|
820
821
|
# Parameter names and values that bind to placeholders in the SQL string.
|
821
822
|
#
|
822
823
|
# A parameter placeholder consists of the `@` character followed by the
|
823
|
-
# parameter name (for example, `@firstName`). Parameter names
|
824
|
-
#
|
824
|
+
# parameter name (for example, `@firstName`). Parameter names must conform
|
825
|
+
# to the naming requirements of identifiers as specified at
|
826
|
+
# https://cloud.google.com/spanner/docs/lexical#identifiers.
|
825
827
|
#
|
826
828
|
# Parameters can appear anywhere that a literal value is expected. The same
|
827
829
|
# parameter name can be used more than once, for example:
|
@@ -1322,6 +1324,12 @@ module Google
|
|
1322
1324
|
# reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
|
1323
1325
|
# the transaction from the beginning, re-using the same session.
|
1324
1326
|
#
|
1327
|
+
# On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
|
1328
|
+
# for example, if the client job experiences a 1+ hour networking failure.
|
1329
|
+
# At that point, Cloud Spanner has lost track of the transaction outcome and
|
1330
|
+
# we recommend that you perform another read from the database to see the
|
1331
|
+
# state of things as they are now.
|
1332
|
+
#
|
1325
1333
|
# @overload commit(request, options = nil)
|
1326
1334
|
# Pass arguments to `commit` via a request object, either of type
|
1327
1335
|
# {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash.
|
@@ -1332,7 +1340,7 @@ module Google
|
|
1332
1340
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1333
1341
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1334
1342
|
#
|
1335
|
-
# @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil)
|
1343
|
+
# @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil)
|
1336
1344
|
# Pass arguments to `commit` via keyword arguments. Note that at
|
1337
1345
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1338
1346
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -1355,6 +1363,10 @@ module Google
|
|
1355
1363
|
# The mutations to be executed when this transaction commits. All
|
1356
1364
|
# mutations are applied atomically, in the order they appear in
|
1357
1365
|
# this list.
|
1366
|
+
# @param return_commit_stats [::Boolean]
|
1367
|
+
# If `true`, then statistics related to the transaction will be included in
|
1368
|
+
# the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. Default value is
|
1369
|
+
# `false`.
|
1358
1370
|
#
|
1359
1371
|
# @yield [response, operation] Access the result along with the RPC operation
|
1360
1372
|
# @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse]
|
@@ -7,6 +7,7 @@ require 'google/api/annotations_pb'
|
|
7
7
|
require 'google/api/client_pb'
|
8
8
|
require 'google/api/field_behavior_pb'
|
9
9
|
require 'google/api/resource_pb'
|
10
|
+
require 'google/protobuf/duration_pb'
|
10
11
|
require 'google/protobuf/empty_pb'
|
11
12
|
require 'google/protobuf/struct_pb'
|
12
13
|
require 'google/protobuf/timestamp_pb'
|
@@ -133,6 +134,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
133
134
|
add_message "google.spanner.v1.CommitRequest" do
|
134
135
|
optional :session, :string, 1
|
135
136
|
repeated :mutations, :message, 4, "google.spanner.v1.Mutation"
|
137
|
+
optional :return_commit_stats, :bool, 5
|
136
138
|
oneof :transaction do
|
137
139
|
optional :transaction_id, :bytes, 2
|
138
140
|
optional :single_use_transaction, :message, 3, "google.spanner.v1.TransactionOptions"
|
@@ -140,6 +142,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
140
142
|
end
|
141
143
|
add_message "google.spanner.v1.CommitResponse" do
|
142
144
|
optional :commit_timestamp, :message, 1, "google.protobuf.Timestamp"
|
145
|
+
optional :commit_stats, :message, 2, "google.spanner.v1.CommitResponse.CommitStats"
|
146
|
+
end
|
147
|
+
add_message "google.spanner.v1.CommitResponse.CommitStats" do
|
148
|
+
optional :mutation_count, :int64, 1
|
143
149
|
end
|
144
150
|
add_message "google.spanner.v1.RollbackRequest" do
|
145
151
|
optional :session, :string, 1
|
@@ -175,6 +181,7 @@ module Google
|
|
175
181
|
BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.BeginTransactionRequest").msgclass
|
176
182
|
CommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitRequest").msgclass
|
177
183
|
CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass
|
184
|
+
CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass
|
178
185
|
RollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RollbackRequest").msgclass
|
179
186
|
end
|
180
187
|
end
|
@@ -134,6 +134,12 @@ module Google
|
|
134
134
|
# transactions. However, it can also happen for a variety of other
|
135
135
|
# reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
|
136
136
|
# the transaction from the beginning, re-using the same session.
|
137
|
+
#
|
138
|
+
# On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
|
139
|
+
# for example, if the client job experiences a 1+ hour networking failure.
|
140
|
+
# At that point, Cloud Spanner has lost track of the transaction outcome and
|
141
|
+
# we recommend that you perform another read from the database to see the
|
142
|
+
# state of things as they are now.
|
137
143
|
rpc :Commit, ::Google::Cloud::Spanner::V1::CommitRequest, ::Google::Cloud::Spanner::V1::CommitResponse
|
138
144
|
# Rolls back a transaction, releasing any locks it holds. It is a good
|
139
145
|
# idea to call this for any transaction that includes one or more
|
@@ -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:
|
@@ -259,6 +259,9 @@ module Google
|
|
259
259
|
# SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
|
260
260
|
# with an invalid optimizer version will fail with a syntax error
|
261
261
|
# (`INVALID_ARGUMENT`) status.
|
262
|
+
# See
|
263
|
+
# https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
|
264
|
+
# for more information on managing the query optimizer.
|
262
265
|
#
|
263
266
|
# The `optimizer_version` statement hint has precedence over this setting.
|
264
267
|
class QueryOptions
|
@@ -650,6 +653,11 @@ module Google
|
|
650
653
|
# The mutations to be executed when this transaction commits. All
|
651
654
|
# mutations are applied atomically, in the order they appear in
|
652
655
|
# this list.
|
656
|
+
# @!attribute [rw] return_commit_stats
|
657
|
+
# @return [::Boolean]
|
658
|
+
# If `true`, then statistics related to the transaction will be included in
|
659
|
+
# the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. Default value is
|
660
|
+
# `false`.
|
653
661
|
class CommitRequest
|
654
662
|
include ::Google::Protobuf::MessageExts
|
655
663
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -659,9 +667,29 @@ module Google
|
|
659
667
|
# @!attribute [rw] commit_timestamp
|
660
668
|
# @return [::Google::Protobuf::Timestamp]
|
661
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}.
|
662
675
|
class CommitResponse
|
663
676
|
include ::Google::Protobuf::MessageExts
|
664
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
|
665
693
|
end
|
666
694
|
|
667
695
|
# 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
|
#
|
@@ -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.3.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: 2021-01-
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|