google-cloud-spanner 1.0.0 → 1.1.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 +5 -5
- data/lib/google-cloud-spanner.rb +13 -10
- data/lib/google/cloud/spanner.rb +21 -18
- data/lib/google/cloud/spanner/admin/database.rb +111 -0
- data/lib/google/cloud/spanner/admin/database/credentials.rb +35 -0
- data/lib/google/cloud/spanner/admin/database/v1.rb +100 -3
- data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +129 -138
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +8 -8
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +12 -2
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +22 -22
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +33 -20
- data/lib/google/cloud/spanner/admin/database/v1/doc/overview.rb +57 -0
- data/lib/google/cloud/spanner/admin/instance.rb +127 -0
- data/lib/google/cloud/spanner/admin/instance/credentials.rb +35 -0
- data/lib/google/cloud/spanner/admin/instance/v1.rb +116 -3
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +8 -8
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +12 -2
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +22 -22
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +58 -43
- data/lib/google/cloud/spanner/admin/instance/v1/doc/overview.rb +57 -0
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +180 -189
- data/lib/google/cloud/spanner/client.rb +3 -3
- data/lib/google/cloud/spanner/credentials.rb +33 -7
- data/lib/google/cloud/spanner/database.rb +3 -6
- data/lib/google/cloud/spanner/instance.rb +2 -4
- data/lib/google/cloud/spanner/instance/config.rb +2 -4
- data/lib/google/cloud/spanner/project.rb +6 -6
- data/lib/google/cloud/spanner/service.rb +5 -26
- data/lib/google/cloud/spanner/session.rb +4 -4
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +14 -1
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +26 -1
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +3 -3
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +12 -12
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +9 -9
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +33 -33
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +99 -28
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +41 -31
- data/lib/google/cloud/spanner/v1/doc/overview.rb +54 -0
- data/lib/google/cloud/spanner/v1/spanner_client.rb +277 -195
- data/lib/google/cloud/spanner/v1/spanner_client_config.json +5 -0
- data/lib/google/cloud/spanner/version.rb +1 -1
- data/lib/google/spanner/v1/spanner_pb.rb +16 -1
- data/lib/google/spanner/v1/spanner_services_pb.rb +2 -0
- metadata +16 -23
@@ -15,24 +15,24 @@
|
|
15
15
|
module Google
|
16
16
|
module Spanner
|
17
17
|
module V1
|
18
|
-
# Results from Read or
|
19
|
-
# ExecuteSql.
|
18
|
+
# Results from {Google::Spanner::V1::Spanner::Read Read} or
|
19
|
+
# {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}.
|
20
20
|
# @!attribute [rw] metadata
|
21
21
|
# @return [Google::Spanner::V1::ResultSetMetadata]
|
22
22
|
# Metadata about the result set, such as row type information.
|
23
23
|
# @!attribute [rw] rows
|
24
24
|
# @return [Array<Google::Protobuf::ListValue>]
|
25
25
|
# Each element in +rows+ is a row whose format is defined by
|
26
|
-
#
|
26
|
+
# {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. The ith element
|
27
27
|
# in each row matches the ith field in
|
28
|
-
#
|
28
|
+
# {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. Elements are
|
29
29
|
# encoded based on type as described
|
30
|
-
#
|
30
|
+
# {Google::Spanner::V1::TypeCode here}.
|
31
31
|
# @!attribute [rw] stats
|
32
32
|
# @return [Google::Spanner::V1::ResultSetStats]
|
33
33
|
# Query plan and execution statistics for the query that produced this
|
34
34
|
# result set. These can be requested by setting
|
35
|
-
# ExecuteSqlRequest#query_mode.
|
35
|
+
# {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}.
|
36
36
|
class ResultSet; end
|
37
37
|
|
38
38
|
# Partial results from a streaming read or SQL query. Streaming reads and
|
@@ -48,18 +48,18 @@ module Google
|
|
48
48
|
# be split into many +PartialResultSet+ messages to accommodate
|
49
49
|
# large rows and/or large values. Every N complete values defines a
|
50
50
|
# row, where N is equal to the number of entries in
|
51
|
-
#
|
51
|
+
# {Google::Spanner::V1::StructType#fields metadata::row_type::fields}.
|
52
52
|
#
|
53
53
|
# Most values are encoded based on type as described
|
54
|
-
#
|
54
|
+
# {Google::Spanner::V1::TypeCode here}.
|
55
55
|
#
|
56
56
|
# It is possible that the last value in values is "chunked",
|
57
57
|
# meaning that the rest of the value is sent in subsequent
|
58
|
-
# +PartialResultSet+(s). This is denoted by the
|
58
|
+
# +PartialResultSet+(s). This is denoted by the {Google::Spanner::V1::PartialResultSet#chunked_value chunked_value}
|
59
59
|
# field. Two or more chunked values can be merged to form a
|
60
60
|
# complete value as follows:
|
61
61
|
#
|
62
|
-
#
|
62
|
+
# * +bool/number/null+: cannot be chunked
|
63
63
|
# * +string+: concatenate the strings
|
64
64
|
# * +list+: concatenate the lists. If the last element in a list is a
|
65
65
|
# +string+, +list+, or +object+, merge it with the first element in
|
@@ -68,31 +68,31 @@ module Google
|
|
68
68
|
# field name is duplicated, then apply these rules recursively
|
69
69
|
# to merge the field values.
|
70
70
|
#
|
71
|
-
#
|
71
|
+
# Some examples of merging:
|
72
72
|
#
|
73
|
-
#
|
74
|
-
#
|
73
|
+
# = Strings are concatenated.
|
74
|
+
# "foo", "bar" => "foobar"
|
75
75
|
#
|
76
|
-
#
|
77
|
-
#
|
76
|
+
# = Lists of non-strings are concatenated.
|
77
|
+
# [2, 3], [4] => [2, 3, 4]
|
78
78
|
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
79
|
+
# = Lists are concatenated, but the last and first elements are merged
|
80
|
+
# = because they are strings.
|
81
|
+
# ["a", "b"], ["c", "d"] => ["a", "bc", "d"]
|
82
82
|
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
83
|
+
# = Lists are concatenated, but the last and first elements are merged
|
84
|
+
# = because they are lists. Recursively, the last and first elements
|
85
|
+
# = of the inner lists are merged because they are strings.
|
86
|
+
# ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"]
|
87
87
|
#
|
88
|
-
#
|
89
|
-
#
|
88
|
+
# = Non-overlapping object fields are combined.
|
89
|
+
# {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"}
|
90
90
|
#
|
91
|
-
#
|
92
|
-
#
|
91
|
+
# = Overlapping object fields are merged.
|
92
|
+
# {"a": "1"}, {"a": "2"} => {"a": "12"}
|
93
93
|
#
|
94
|
-
#
|
95
|
-
#
|
94
|
+
# = Examples of merging objects containing lists of strings.
|
95
|
+
# {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]}
|
96
96
|
#
|
97
97
|
# For a more complete example, suppose a streaming SQL query is
|
98
98
|
# yielding a result set whose rows contain a single string
|
@@ -119,7 +119,7 @@ module Google
|
|
119
119
|
# field value +"World" = "W" + "orl" + "d"+.
|
120
120
|
# @!attribute [rw] chunked_value
|
121
121
|
# @return [true, false]
|
122
|
-
# If true, then the final value in
|
122
|
+
# If true, then the final value in {Google::Spanner::V1::PartialResultSet#values values} is chunked, and must
|
123
123
|
# be combined with more values from subsequent +PartialResultSet+s
|
124
124
|
# to obtain a complete field value.
|
125
125
|
# @!attribute [rw] resume_token
|
@@ -133,11 +133,11 @@ module Google
|
|
133
133
|
# @return [Google::Spanner::V1::ResultSetStats]
|
134
134
|
# Query plan and execution statistics for the query that produced this
|
135
135
|
# streaming result set. These can be requested by setting
|
136
|
-
# ExecuteSqlRequest#query_mode and are sent
|
136
|
+
# {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode} and are sent
|
137
137
|
# only once with the last response in the stream.
|
138
138
|
class PartialResultSet; end
|
139
139
|
|
140
|
-
# Metadata about a ResultSet or PartialResultSet.
|
140
|
+
# Metadata about a {Google::Spanner::V1::ResultSet ResultSet} or {Google::Spanner::V1::PartialResultSet PartialResultSet}.
|
141
141
|
# @!attribute [rw] row_type
|
142
142
|
# @return [Google::Spanner::V1::StructType]
|
143
143
|
# Indicates the field names and types for the rows in the result
|
@@ -154,10 +154,10 @@ module Google
|
|
154
154
|
# information about the new transaction is yielded here.
|
155
155
|
class ResultSetMetadata; end
|
156
156
|
|
157
|
-
# Additional statistics about a ResultSet or PartialResultSet.
|
157
|
+
# Additional statistics about a {Google::Spanner::V1::ResultSet ResultSet} or {Google::Spanner::V1::PartialResultSet PartialResultSet}.
|
158
158
|
# @!attribute [rw] query_plan
|
159
159
|
# @return [Google::Spanner::V1::QueryPlan]
|
160
|
-
# QueryPlan for the query associated with this result.
|
160
|
+
# {Google::Spanner::V1::QueryPlan QueryPlan} for the query associated with this result.
|
161
161
|
# @!attribute [rw] query_stats
|
162
162
|
# @return [Google::Protobuf::Struct]
|
163
163
|
# Aggregated statistics from the execution of the query. Only present when
|
@@ -14,33 +14,104 @@
|
|
14
14
|
|
15
15
|
module Google
|
16
16
|
module Spanner
|
17
|
+
##
|
18
|
+
# # Cloud Spanner API Contents
|
19
|
+
#
|
20
|
+
# | Class | Description |
|
21
|
+
# | ----- | ----------- |
|
22
|
+
# | [SpannerClient][] | Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. |
|
23
|
+
# | [Data Types][] | Data types for Google::Cloud::Spanner::V1 |
|
24
|
+
#
|
25
|
+
# [SpannerClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-spanner/latest/google/spanner/v1/spannerclient
|
26
|
+
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-spanner/latest/google/spanner/v1/datatypes
|
27
|
+
#
|
17
28
|
module V1
|
18
|
-
# The request for CreateSession.
|
29
|
+
# The request for {Google::Spanner::V1::Spanner::CreateSession CreateSession}.
|
19
30
|
# @!attribute [rw] database
|
20
31
|
# @return [String]
|
21
32
|
# Required. The database in which the new session is created.
|
33
|
+
# @!attribute [rw] session
|
34
|
+
# @return [Google::Spanner::V1::Session]
|
35
|
+
# The session to create.
|
22
36
|
class CreateSessionRequest; end
|
23
37
|
|
24
38
|
# A session in the Cloud Spanner API.
|
25
39
|
# @!attribute [rw] name
|
26
40
|
# @return [String]
|
27
|
-
#
|
41
|
+
# The name of the session. This is always system-assigned; values provided
|
42
|
+
# when creating a session are ignored.
|
43
|
+
# @!attribute [rw] labels
|
44
|
+
# @return [Hash{String => String}]
|
45
|
+
# The labels for the session.
|
46
|
+
#
|
47
|
+
# * Label keys must be between 1 and 63 characters long and must conform to
|
48
|
+
# the following regular expression: +[a-z](https://cloud.google.com[-a-z0-9]*[a-z0-9])?+.
|
49
|
+
# * Label values must be between 0 and 63 characters long and must conform
|
50
|
+
# to the regular expression +([a-z](https://cloud.google.com[-a-z0-9]*[a-z0-9])?)?+.
|
51
|
+
# * No more than 64 labels can be associated with a given session.
|
52
|
+
#
|
53
|
+
# See https://goo.gl/xmQnxf for more information on and examples of labels.
|
54
|
+
# @!attribute [rw] create_time
|
55
|
+
# @return [Google::Protobuf::Timestamp]
|
56
|
+
# Output only. The timestamp when the session is created.
|
57
|
+
# @!attribute [rw] approximate_last_use_time
|
58
|
+
# @return [Google::Protobuf::Timestamp]
|
59
|
+
# Output only. The approximate timestamp when the session is last used. It is
|
60
|
+
# typically earlier than the actual last use time.
|
28
61
|
class Session; end
|
29
62
|
|
30
|
-
# The request for GetSession.
|
63
|
+
# The request for {Google::Spanner::V1::Spanner::GetSession GetSession}.
|
31
64
|
# @!attribute [rw] name
|
32
65
|
# @return [String]
|
33
66
|
# Required. The name of the session to retrieve.
|
34
67
|
class GetSessionRequest; end
|
35
68
|
|
36
|
-
# The request for
|
69
|
+
# The request for {Google::Spanner::V1::Spanner::ListSessions ListSessions}.
|
70
|
+
# @!attribute [rw] database
|
71
|
+
# @return [String]
|
72
|
+
# Required. The database in which to list sessions.
|
73
|
+
# @!attribute [rw] page_size
|
74
|
+
# @return [Integer]
|
75
|
+
# Number of sessions to be returned in the response. If 0 or less, defaults
|
76
|
+
# to the server's maximum allowed page size.
|
77
|
+
# @!attribute [rw] page_token
|
78
|
+
# @return [String]
|
79
|
+
# If non-empty, +page_token+ should contain a
|
80
|
+
# {Google::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} from a previous
|
81
|
+
# {Google::Spanner::V1::ListSessionsResponse ListSessionsResponse}.
|
82
|
+
# @!attribute [rw] filter
|
83
|
+
# @return [String]
|
84
|
+
# An expression for filtering the results of the request. Filter rules are
|
85
|
+
# case insensitive. The fields eligible for filtering are:
|
86
|
+
#
|
87
|
+
# * +labels.key+ where key is the name of a label
|
88
|
+
#
|
89
|
+
# Some examples of using filters are:
|
90
|
+
#
|
91
|
+
# * +labels.env:*+ --> The session has the label "env".
|
92
|
+
# * +labels.env:dev+ --> The session has the label "env" and the value of
|
93
|
+
# the label contains the string "dev".
|
94
|
+
class ListSessionsRequest; end
|
95
|
+
|
96
|
+
# The response for {Google::Spanner::V1::Spanner::ListSessions ListSessions}.
|
97
|
+
# @!attribute [rw] sessions
|
98
|
+
# @return [Array<Google::Spanner::V1::Session>]
|
99
|
+
# The list of requested sessions.
|
100
|
+
# @!attribute [rw] next_page_token
|
101
|
+
# @return [String]
|
102
|
+
# +next_page_token+ can be sent in a subsequent
|
103
|
+
# {Google::Spanner::V1::Spanner::ListSessions ListSessions} call to fetch more of the matching
|
104
|
+
# sessions.
|
105
|
+
class ListSessionsResponse; end
|
106
|
+
|
107
|
+
# The request for {Google::Spanner::V1::Spanner::DeleteSession DeleteSession}.
|
37
108
|
# @!attribute [rw] name
|
38
109
|
# @return [String]
|
39
110
|
# Required. The name of the session to delete.
|
40
111
|
class DeleteSessionRequest; end
|
41
112
|
|
42
|
-
# The request for ExecuteSql and
|
43
|
-
# ExecuteStreamingSql.
|
113
|
+
# The request for {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} and
|
114
|
+
# {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql}.
|
44
115
|
# @!attribute [rw] session
|
45
116
|
# @return [String]
|
46
117
|
# Required. The session in which the SQL query should be performed.
|
@@ -71,24 +142,24 @@ module Google
|
|
71
142
|
# @return [Hash{String => Google::Spanner::V1::Type}]
|
72
143
|
# It is not always possible for Cloud Spanner to infer the right SQL type
|
73
144
|
# from a JSON value. For example, values of type +BYTES+ and values
|
74
|
-
# of type +STRING+ both appear in
|
145
|
+
# of type +STRING+ both appear in {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings.
|
75
146
|
#
|
76
147
|
# In these cases, +param_types+ can be used to specify the exact
|
77
148
|
# SQL type for some or all of the SQL query parameters. See the
|
78
|
-
# definition of Type for more information
|
149
|
+
# definition of {Google::Spanner::V1::Type Type} for more information
|
79
150
|
# about SQL types.
|
80
151
|
# @!attribute [rw] resume_token
|
81
152
|
# @return [String]
|
82
153
|
# If this request is resuming a previously interrupted SQL query
|
83
154
|
# execution, +resume_token+ should be copied from the last
|
84
|
-
# PartialResultSet yielded before the interruption. Doing this
|
155
|
+
# {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
|
85
156
|
# enables the new SQL query execution to resume where the last one left
|
86
157
|
# off. The rest of the request parameters must exactly match the
|
87
158
|
# request that yielded this token.
|
88
159
|
# @!attribute [rw] query_mode
|
89
160
|
# @return [Google::Spanner::V1::ExecuteSqlRequest::QueryMode]
|
90
161
|
# Used to control the amount of debugging information returned in
|
91
|
-
# ResultSetStats.
|
162
|
+
# {Google::Spanner::V1::ResultSetStats ResultSetStats}.
|
92
163
|
class ExecuteSqlRequest
|
93
164
|
# Mode in which the query must be processed.
|
94
165
|
module QueryMode
|
@@ -106,8 +177,8 @@ module Google
|
|
106
177
|
end
|
107
178
|
end
|
108
179
|
|
109
|
-
# The request for Read and
|
110
|
-
# StreamingRead.
|
180
|
+
# The request for {Google::Spanner::V1::Spanner::Read Read} and
|
181
|
+
# {Google::Spanner::V1::Spanner::StreamingRead StreamingRead}.
|
111
182
|
# @!attribute [rw] session
|
112
183
|
# @return [String]
|
113
184
|
# Required. The session in which the read should be performed.
|
@@ -120,22 +191,22 @@ module Google
|
|
120
191
|
# Required. The name of the table in the database to be read.
|
121
192
|
# @!attribute [rw] index
|
122
193
|
# @return [String]
|
123
|
-
# If non-empty, the name of an index on
|
124
|
-
# used instead of the table primary key when interpreting
|
125
|
-
# and sorting result rows. See
|
194
|
+
# If non-empty, the name of an index on {Google::Spanner::V1::ReadRequest#table table}. This index is
|
195
|
+
# used instead of the table primary key when interpreting {Google::Spanner::V1::ReadRequest#key_set key_set}
|
196
|
+
# and sorting result rows. See {Google::Spanner::V1::ReadRequest#key_set key_set} for further information.
|
126
197
|
# @!attribute [rw] columns
|
127
198
|
# @return [Array<String>]
|
128
|
-
# The columns of
|
199
|
+
# The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned for each row matching
|
129
200
|
# this request.
|
130
201
|
# @!attribute [rw] key_set
|
131
202
|
# @return [Google::Spanner::V1::KeySet]
|
132
203
|
# Required. +key_set+ identifies the rows to be yielded. +key_set+ names the
|
133
|
-
# primary keys of the rows in
|
134
|
-
# is present. If
|
135
|
-
# index keys in
|
204
|
+
# primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to be yielded, unless {Google::Spanner::V1::ReadRequest#index index}
|
205
|
+
# is present. If {Google::Spanner::V1::ReadRequest#index index} is present, then {Google::Spanner::V1::ReadRequest#key_set key_set} instead names
|
206
|
+
# index keys in {Google::Spanner::V1::ReadRequest#index index}.
|
136
207
|
#
|
137
|
-
# Rows are yielded in table primary key order (if
|
138
|
-
# or index key order (if
|
208
|
+
# Rows are yielded in table primary key order (if {Google::Spanner::V1::ReadRequest#index index} is empty)
|
209
|
+
# or index key order (if {Google::Spanner::V1::ReadRequest#index index} is non-empty).
|
139
210
|
#
|
140
211
|
# It is not an error for the +key_set+ to name rows that do not
|
141
212
|
# exist in the database. Read yields nothing for nonexistent rows.
|
@@ -147,13 +218,13 @@ module Google
|
|
147
218
|
# @return [String]
|
148
219
|
# If this request is resuming a previously interrupted read,
|
149
220
|
# +resume_token+ should be copied from the last
|
150
|
-
# PartialResultSet yielded before the interruption. Doing this
|
221
|
+
# {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
|
151
222
|
# enables the new read to resume where the last read left off. The
|
152
223
|
# rest of the request parameters must exactly match the request
|
153
224
|
# that yielded this token.
|
154
225
|
class ReadRequest; end
|
155
226
|
|
156
|
-
# The request for BeginTransaction.
|
227
|
+
# The request for {Google::Spanner::V1::Spanner::BeginTransaction BeginTransaction}.
|
157
228
|
# @!attribute [rw] session
|
158
229
|
# @return [String]
|
159
230
|
# Required. The session in which the transaction runs.
|
@@ -162,7 +233,7 @@ module Google
|
|
162
233
|
# Required. Options for the new transaction.
|
163
234
|
class BeginTransactionRequest; end
|
164
235
|
|
165
|
-
# The request for Commit.
|
236
|
+
# The request for {Google::Spanner::V1::Spanner::Commit Commit}.
|
166
237
|
# @!attribute [rw] session
|
167
238
|
# @return [String]
|
168
239
|
# Required. The session in which the transaction to be committed is running.
|
@@ -178,8 +249,8 @@ module Google
|
|
178
249
|
# instance, due to retries in the application, or in the
|
179
250
|
# transport library), it is possible that the mutations are
|
180
251
|
# executed more than once. If this is undesirable, use
|
181
|
-
# BeginTransaction and
|
182
|
-
# Commit instead.
|
252
|
+
# {Google::Spanner::V1::Spanner::BeginTransaction BeginTransaction} and
|
253
|
+
# {Google::Spanner::V1::Spanner::Commit Commit} instead.
|
183
254
|
# @!attribute [rw] mutations
|
184
255
|
# @return [Array<Google::Spanner::V1::Mutation>]
|
185
256
|
# The mutations to be executed when this transaction commits. All
|
@@ -187,13 +258,13 @@ module Google
|
|
187
258
|
# this list.
|
188
259
|
class CommitRequest; end
|
189
260
|
|
190
|
-
# The response for Commit.
|
261
|
+
# The response for {Google::Spanner::V1::Spanner::Commit Commit}.
|
191
262
|
# @!attribute [rw] commit_timestamp
|
192
263
|
# @return [Google::Protobuf::Timestamp]
|
193
264
|
# The Cloud Spanner timestamp at which the transaction committed.
|
194
265
|
class CommitResponse; end
|
195
266
|
|
196
|
-
# The request for Rollback.
|
267
|
+
# The request for {Google::Spanner::V1::Spanner::Rollback Rollback}.
|
197
268
|
# @!attribute [rw] session
|
198
269
|
# @return [String]
|
199
270
|
# Required. The session in which the transaction to roll back is running.
|
@@ -59,8 +59,8 @@ module Google
|
|
59
59
|
# and cause less contention. Cloud Spanner attempts to keep read locks
|
60
60
|
# active as long as the transaction continues to do reads, and the
|
61
61
|
# transaction has not been terminated by
|
62
|
-
# Commit or
|
63
|
-
# Rollback. Long periods of
|
62
|
+
# {Google::Spanner::V1::Spanner::Commit Commit} or
|
63
|
+
# {Google::Spanner::V1::Spanner::Rollback Rollback}. Long periods of
|
64
64
|
# inactivity at the client may cause Cloud Spanner to release a
|
65
65
|
# transaction's locks and abort it.
|
66
66
|
#
|
@@ -69,9 +69,9 @@ module Google
|
|
69
69
|
# have been completed.
|
70
70
|
# Conceptually, a read-write transaction consists of zero or more
|
71
71
|
# reads or SQL queries followed by
|
72
|
-
# Commit. At any time before
|
73
|
-
# Commit, the client can send a
|
74
|
-
# Rollback request to abort the
|
72
|
+
# {Google::Spanner::V1::Spanner::Commit Commit}. At any time before
|
73
|
+
# {Google::Spanner::V1::Spanner::Commit Commit}, the client can send a
|
74
|
+
# {Google::Spanner::V1::Spanner::Rollback Rollback} request to abort the
|
75
75
|
# transaction.
|
76
76
|
#
|
77
77
|
# === Semantics
|
@@ -133,8 +133,8 @@ module Google
|
|
133
133
|
# need to worry about this in practice.
|
134
134
|
#
|
135
135
|
# Snapshot read-only transactions do not need to call
|
136
|
-
# Commit or
|
137
|
-
# Rollback (and in fact are not
|
136
|
+
# {Google::Spanner::V1::Spanner::Commit Commit} or
|
137
|
+
# {Google::Spanner::V1::Spanner::Rollback Rollback} (and in fact are not
|
138
138
|
# permitted to do so).
|
139
139
|
#
|
140
140
|
# To execute a snapshot transaction, the client specifies a timestamp
|
@@ -142,14 +142,14 @@ module Google
|
|
142
142
|
#
|
143
143
|
# The types of timestamp bound are:
|
144
144
|
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
145
|
+
# * Strong (the default).
|
146
|
+
# * Bounded staleness.
|
147
|
+
# * Exact staleness.
|
148
148
|
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
149
|
+
# If the Cloud Spanner database to be read is geographically distributed,
|
150
|
+
# stale read-only transactions can execute more quickly than strong
|
151
|
+
# or read-write transaction, because they are able to execute far
|
152
|
+
# from the leader replica.
|
153
153
|
#
|
154
154
|
# Each type of timestamp bound is discussed in detail below.
|
155
155
|
#
|
@@ -167,7 +167,7 @@ module Google
|
|
167
167
|
# reads should be executed within a transaction or at an exact read
|
168
168
|
# timestamp.
|
169
169
|
#
|
170
|
-
# See TransactionOptions::ReadOnly#strong.
|
170
|
+
# See {Google::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions::ReadOnly#strong}.
|
171
171
|
#
|
172
172
|
# === Exact Staleness
|
173
173
|
#
|
@@ -188,8 +188,8 @@ module Google
|
|
188
188
|
# equivalent boundedly stale concurrency modes. On the other hand,
|
189
189
|
# boundedly stale reads usually return fresher results.
|
190
190
|
#
|
191
|
-
# See TransactionOptions::ReadOnly#read_timestamp and
|
192
|
-
# TransactionOptions::ReadOnly#exact_staleness.
|
191
|
+
# See {Google::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions::ReadOnly#read_timestamp} and
|
192
|
+
# {Google::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions::ReadOnly#exact_staleness}.
|
193
193
|
#
|
194
194
|
# === Bounded Staleness
|
195
195
|
#
|
@@ -218,8 +218,8 @@ module Google
|
|
218
218
|
# which rows will be read, it can only be used with single-use
|
219
219
|
# read-only transactions.
|
220
220
|
#
|
221
|
-
# See TransactionOptions::ReadOnly#max_staleness and
|
222
|
-
# TransactionOptions::ReadOnly#min_read_timestamp.
|
221
|
+
# See {Google::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions::ReadOnly#max_staleness} and
|
222
|
+
# {Google::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions::ReadOnly#min_read_timestamp}.
|
223
223
|
#
|
224
224
|
# === Old Read Timestamps and Garbage Collection
|
225
225
|
#
|
@@ -246,10 +246,11 @@ module Google
|
|
246
246
|
# +spanner.databases.beginReadOnlyTransaction+ permission
|
247
247
|
# on the +session+ resource.
|
248
248
|
class TransactionOptions
|
249
|
-
#
|
249
|
+
# Message type to initiate a read-write transaction. Currently this
|
250
|
+
# transaction type has no options.
|
250
251
|
class ReadWrite; end
|
251
252
|
|
252
|
-
#
|
253
|
+
# Message type to initiate a read-only transaction.
|
253
254
|
# @!attribute [rw] strong
|
254
255
|
# @return [true, false]
|
255
256
|
# Read at a timestamp where all previously committed transactions
|
@@ -263,6 +264,9 @@ module Google
|
|
263
264
|
# previously committed transaction whose timestamp is known.
|
264
265
|
#
|
265
266
|
# Note that this option can only be used in single-use transactions.
|
267
|
+
#
|
268
|
+
# A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
|
269
|
+
# Example: +"2014-10-02T15:01:23.045123456Z"+.
|
266
270
|
# @!attribute [rw] max_staleness
|
267
271
|
# @return [Google::Protobuf::Duration]
|
268
272
|
# Read data at a timestamp >= +NOW - max_staleness+
|
@@ -289,6 +293,9 @@ module Google
|
|
289
293
|
# Useful for large scale consistent reads such as mapreduces, or
|
290
294
|
# for coordinating many reads against a consistent snapshot of the
|
291
295
|
# data.
|
296
|
+
#
|
297
|
+
# A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
|
298
|
+
# Example: +"2014-10-02T15:01:23.045123456Z"+.
|
292
299
|
# @!attribute [rw] exact_staleness
|
293
300
|
# @return [Google::Protobuf::Duration]
|
294
301
|
# Executes all reads at a timestamp that is +exact_staleness+
|
@@ -305,7 +312,7 @@ module Google
|
|
305
312
|
# @!attribute [rw] return_read_timestamp
|
306
313
|
# @return [true, false]
|
307
314
|
# If true, the Cloud Spanner-selected read timestamp is included in
|
308
|
-
# the Transaction message that describes the transaction.
|
315
|
+
# the {Google::Spanner::V1::Transaction Transaction} message that describes the transaction.
|
309
316
|
class ReadOnly; end
|
310
317
|
end
|
311
318
|
|
@@ -313,10 +320,10 @@ module Google
|
|
313
320
|
# @!attribute [rw] id
|
314
321
|
# @return [String]
|
315
322
|
# +id+ may be used to identify the transaction in subsequent
|
316
|
-
# Read,
|
317
|
-
# ExecuteSql,
|
318
|
-
# Commit, or
|
319
|
-
# Rollback calls.
|
323
|
+
# {Google::Spanner::V1::Spanner::Read Read},
|
324
|
+
# {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql},
|
325
|
+
# {Google::Spanner::V1::Spanner::Commit Commit}, or
|
326
|
+
# {Google::Spanner::V1::Spanner::Rollback Rollback} calls.
|
320
327
|
#
|
321
328
|
# Single-use read-only transactions do not have IDs, because
|
322
329
|
# single-use transactions do not support multiple requests.
|
@@ -324,14 +331,17 @@ module Google
|
|
324
331
|
# @return [Google::Protobuf::Timestamp]
|
325
332
|
# For snapshot read-only transactions, the read timestamp chosen
|
326
333
|
# for the transaction. Not returned by default: see
|
327
|
-
# TransactionOptions::ReadOnly#return_read_timestamp.
|
334
|
+
# {Google::Spanner::V1::TransactionOptions::ReadOnly#return_read_timestamp TransactionOptions::ReadOnly#return_read_timestamp}.
|
335
|
+
#
|
336
|
+
# A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
|
337
|
+
# Example: +"2014-10-02T15:01:23.045123456Z"+.
|
328
338
|
class Transaction; end
|
329
339
|
|
330
340
|
# This message is used to select the transaction in which a
|
331
|
-
# Read or
|
332
|
-
# ExecuteSql call runs.
|
341
|
+
# {Google::Spanner::V1::Spanner::Read Read} or
|
342
|
+
# {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} call runs.
|
333
343
|
#
|
334
|
-
# See TransactionOptions for more information about transactions.
|
344
|
+
# See {Google::Spanner::V1::TransactionOptions TransactionOptions} for more information about transactions.
|
335
345
|
# @!attribute [rw] single_use
|
336
346
|
# @return [Google::Spanner::V1::TransactionOptions]
|
337
347
|
# Execute the read or SQL query in a temporary transaction.
|
@@ -344,7 +354,7 @@ module Google
|
|
344
354
|
# @return [Google::Spanner::V1::TransactionOptions]
|
345
355
|
# Begin a new transaction and execute this read or SQL query in
|
346
356
|
# it. The transaction ID of the new transaction is returned in
|
347
|
-
# ResultSetMetadata#transaction, which is a Transaction.
|
357
|
+
# {Google::Spanner::V1::ResultSetMetadata#transaction ResultSetMetadata#transaction}, which is a {Google::Spanner::V1::Transaction Transaction}.
|
348
358
|
class TransactionSelector; end
|
349
359
|
end
|
350
360
|
end
|