google-cloud-spanner 1.12.0 → 1.12.2

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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +14 -11
  4. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +6 -5
  5. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +1 -1
  6. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +6 -5
  7. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +96 -44
  8. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +20 -14
  9. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +2 -2
  10. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +22 -24
  11. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +18 -21
  12. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +19 -23
  13. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +86 -76
  14. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +6 -14
  15. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb +8 -11
  16. data/lib/google/cloud/spanner/v1/spanner_client.rb +64 -72
  17. data/lib/google/cloud/spanner/version.rb +1 -1
  18. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +3 -0
  19. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +13 -11
  20. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +19 -0
  21. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +5 -4
  22. data/lib/google/spanner/v1/keys_pb.rb +1 -1
  23. data/lib/google/spanner/v1/mutation_pb.rb +1 -1
  24. data/lib/google/spanner/v1/query_plan_pb.rb +1 -1
  25. data/lib/google/spanner/v1/result_set_pb.rb +1 -1
  26. data/lib/google/spanner/v1/spanner_pb.rb +3 -0
  27. data/lib/google/spanner/v1/spanner_services_pb.rb +9 -17
  28. data/lib/google/spanner/v1/transaction_pb.rb +1 -1
  29. metadata +42 -2
@@ -137,8 +137,8 @@ module Google
137
137
  # encoded as described {Google::Spanner::V1::TypeCode here}.
138
138
  # @!attribute [rw] ranges
139
139
  # @return [Array<Google::Spanner::V1::KeyRange>]
140
- # A list of key ranges. See {Google::Spanner::V1::KeyRange KeyRange} for more
141
- # information about key range specifications.
140
+ # A list of key ranges. See {Google::Spanner::V1::KeyRange KeyRange} for more information about
141
+ # key range specifications.
142
142
  # @!attribute [rw] all
143
143
  # @return [true, false]
144
144
  # For convenience `all` can be set to `true` to indicate that this
@@ -29,32 +29,33 @@ module Google
29
29
  # already exist, the transaction fails with error `NOT_FOUND`.
30
30
  # @!attribute [rw] insert_or_update
31
31
  # @return [Google::Spanner::V1::Mutation::Write]
32
- # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row
33
- # already exists, then its column values are overwritten with the ones
34
- # provided. Any column values not explicitly written are preserved.
32
+ # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row already exists, then
33
+ # its column values are overwritten with the ones provided. Any
34
+ # column values not explicitly written are preserved.
35
35
  # @!attribute [rw] replace
36
36
  # @return [Google::Spanner::V1::Mutation::Write]
37
- # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row
38
- # already exists, it is deleted, and the column values provided are
39
- # inserted instead. Unlike
40
- # {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, this
41
- # means any values not explicitly written become `NULL`.
37
+ # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row already exists, it is
38
+ # deleted, and the column values provided are inserted
39
+ # instead. Unlike {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, this means any values not
40
+ # explicitly written become `NULL`.
41
+ #
42
+ # In an interleaved table, if you create the child table with the
43
+ # `ON DELETE CASCADE` annotation, then replacing a parent row
44
+ # also deletes the child rows. Otherwise, you must delete the
45
+ # child rows before you replace the parent row.
42
46
  # @!attribute [rw] delete
43
47
  # @return [Google::Spanner::V1::Mutation::Delete]
44
48
  # Delete rows from a table. Succeeds whether or not the named
45
49
  # rows were present.
46
50
  class Mutation
47
- # Arguments to {Google::Spanner::V1::Mutation#insert insert},
48
- # {Google::Spanner::V1::Mutation#update update},
49
- # {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, and
51
+ # Arguments to {Google::Spanner::V1::Mutation#insert insert}, {Google::Spanner::V1::Mutation#update update}, {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, and
50
52
  # {Google::Spanner::V1::Mutation#replace replace} operations.
51
53
  # @!attribute [rw] table
52
54
  # @return [String]
53
55
  # Required. The table whose rows will be written.
54
56
  # @!attribute [rw] columns
55
57
  # @return [Array<String>]
56
- # The names of the columns in
57
- # {Google::Spanner::V1::Mutation::Write#table table} to be written.
58
+ # The names of the columns in {Google::Spanner::V1::Mutation::Write#table table} to be written.
58
59
  #
59
60
  # The list of columns must contain enough columns to allow
60
61
  # Cloud Spanner to derive values for all primary key columns in the
@@ -64,13 +65,11 @@ module Google
64
65
  # The values to be written. `values` can contain more than one
65
66
  # list of values. If it does, then multiple rows are written, one
66
67
  # for each entry in `values`. Each list in `values` must have
67
- # exactly as many entries as there are entries in
68
- # {Google::Spanner::V1::Mutation::Write#columns columns} above. Sending
69
- # multiple lists is equivalent to sending multiple `Mutation`s, each
70
- # containing one `values` entry and repeating
71
- # {Google::Spanner::V1::Mutation::Write#table table} and
72
- # {Google::Spanner::V1::Mutation::Write#columns columns}. Individual values in
73
- # each list are encoded as described {Google::Spanner::V1::TypeCode here}.
68
+ # exactly as many entries as there are entries in {Google::Spanner::V1::Mutation::Write#columns columns}
69
+ # above. Sending multiple lists is equivalent to sending multiple
70
+ # `Mutation`s, each containing one `values` entry and repeating
71
+ # {Google::Spanner::V1::Mutation::Write#table table} and {Google::Spanner::V1::Mutation::Write#columns columns}. Individual values in each list are
72
+ # encoded as described {Google::Spanner::V1::TypeCode here}.
74
73
  class Write; end
75
74
 
76
75
  # Arguments to {Google::Spanner::V1::Mutation#delete delete} operations.
@@ -79,10 +78,9 @@ module Google
79
78
  # Required. The table whose rows will be deleted.
80
79
  # @!attribute [rw] key_set
81
80
  # @return [Google::Spanner::V1::KeySet]
82
- # Required. The primary keys of the rows within
83
- # {Google::Spanner::V1::Mutation::Delete#table table} to delete. Delete is
84
- # idempotent. The transaction will succeed even if some or all rows do not
85
- # exist.
81
+ # Required. The primary keys of the rows within {Google::Spanner::V1::Mutation::Delete#table table} to delete.
82
+ # Delete is idempotent. The transaction will succeed even if some or all
83
+ # rows do not exist.
86
84
  class Delete; end
87
85
  end
88
86
  end
@@ -16,19 +16,17 @@
16
16
  module Google
17
17
  module Spanner
18
18
  module V1
19
- # Node information for nodes appearing in a
20
- # {Google::Spanner::V1::QueryPlan#plan_nodes QueryPlan#plan_nodes}.
19
+ # Node information for nodes appearing in a {Google::Spanner::V1::QueryPlan#plan_nodes QueryPlan#plan_nodes}.
21
20
  # @!attribute [rw] index
22
21
  # @return [Integer]
23
- # The `PlanNode`'s index in [node
24
- # list][google.spanner.v1.QueryPlan.plan_nodes].
22
+ # The `PlanNode`'s index in {Google::Spanner::V1::QueryPlan#plan_nodes node list}.
25
23
  # @!attribute [rw] kind
26
24
  # @return [Google::Spanner::V1::PlanNode::Kind]
27
25
  # Used to determine the type of node. May be needed for visualizing
28
26
  # different kinds of nodes differently. For example, If the node is a
29
- # {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a
30
- # condensed representation which can be used to directly embed a description
31
- # of the node in its parent.
27
+ # {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a condensed representation
28
+ # which can be used to directly embed a description of the node in its
29
+ # parent.
32
30
  # @!attribute [rw] display_name
33
31
  # @return [String]
34
32
  # The display name for the node.
@@ -37,8 +35,7 @@ module Google
37
35
  # List of child node `index`es and their relationship to this parent.
38
36
  # @!attribute [rw] short_representation
39
37
  # @return [Google::Spanner::V1::PlanNode::ShortRepresentation]
40
- # Condensed representation for
41
- # {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes.
38
+ # Condensed representation for {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes.
42
39
  # @!attribute [rw] metadata
43
40
  # @return [Google::Protobuf::Struct]
44
41
  # Attributes relevant to the node contained in a group of key-value pairs.
@@ -69,14 +66,14 @@ module Google
69
66
  # with the output variable.
70
67
  # @!attribute [rw] variable
71
68
  # @return [String]
72
- # Only present if the child node is
73
- # {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds to an
74
- # output variable of the parent node. The field carries the name of the
75
- # output variable. For example, a `TableScan` operator that reads rows from
76
- # a table will have child links to the `SCALAR` nodes representing the
77
- # output variables created for each column that is read by the operator.
78
- # The corresponding `variable` fields will be set to the variable names
79
- # assigned to the columns.
69
+ # Only present if the child node is {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds
70
+ # to an output variable of the parent node. The field carries the name of
71
+ # the output variable.
72
+ # For example, a `TableScan` operator that reads rows from a table will
73
+ # have child links to the `SCALAR` nodes representing the output variables
74
+ # created for each column that is read by the operator. The corresponding
75
+ # `variable` fields will be set to the variable names assigned to the
76
+ # columns.
80
77
  class ChildLink; end
81
78
 
82
79
  # Condensed representation of a node and its subtree. Only present for
@@ -93,8 +90,8 @@ module Google
93
90
  # this node.
94
91
  class ShortRepresentation; end
95
92
 
96
- # The kind of {Google::Spanner::V1::PlanNode PlanNode}. Distinguishes between
97
- # the two different kinds of nodes that can appear in a query plan.
93
+ # The kind of {Google::Spanner::V1::PlanNode PlanNode}. Distinguishes between the two different kinds of
94
+ # nodes that can appear in a query plan.
98
95
  module Kind
99
96
  # Not specified.
100
97
  KIND_UNSPECIFIED = 0
@@ -116,8 +113,8 @@ module Google
116
113
  # @!attribute [rw] plan_nodes
117
114
  # @return [Array<Google::Spanner::V1::PlanNode>]
118
115
  # The nodes in the query plan. Plan nodes are returned in pre-order starting
119
- # with the plan root. Each {Google::Spanner::V1::PlanNode PlanNode}'s `id`
120
- # corresponds to its index in `plan_nodes`.
116
+ # with the plan root. Each {Google::Spanner::V1::PlanNode PlanNode}'s `id` corresponds to its index in
117
+ # `plan_nodes`.
121
118
  class QueryPlan; end
122
119
  end
123
120
  end
@@ -24,10 +24,11 @@ module Google
24
24
  # @!attribute [rw] rows
25
25
  # @return [Array<Google::Protobuf::ListValue>]
26
26
  # Each element in `rows` is a row whose format is defined by
27
- # {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. The ith
28
- # element in each row matches the ith field in
29
- # {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. Elements
30
- # are encoded based on type as described {Google::Spanner::V1::TypeCode here}.
27
+ # {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. The ith element
28
+ # in each row matches the ith field in
29
+ # {Google::Spanner::V1::ResultSetMetadata#row_type metadata::row_type}. Elements are
30
+ # encoded based on type as described
31
+ # {Google::Spanner::V1::TypeCode here}.
31
32
  # @!attribute [rw] stats
32
33
  # @return [Google::Spanner::V1::ResultSetStats]
33
34
  # Query plan and execution statistics for the SQL statement that
@@ -35,8 +36,7 @@ module Google
35
36
  # {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}.
36
37
  # DML statements always produce stats containing the number of rows
37
38
  # modified, unless executed using the
38
- # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest::QueryMode::PLAN}
39
- # {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}.
39
+ # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest::QueryMode::PLAN} {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}.
40
40
  # Other fields may or may not be populated, based on the
41
41
  # {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}.
42
42
  class ResultSet; end
@@ -61,10 +61,9 @@ module Google
61
61
  #
62
62
  # It is possible that the last value in values is "chunked",
63
63
  # meaning that the rest of the value is sent in subsequent
64
- # `PartialResultSet`(s). This is denoted by the
65
- # {Google::Spanner::V1::PartialResultSet#chunked_value chunked_value} field.
66
- # Two or more chunked values can be merged to form a complete value as
67
- # follows:
64
+ # `PartialResultSet`(s). This is denoted by the {Google::Spanner::V1::PartialResultSet#chunked_value chunked_value}
65
+ # field. Two or more chunked values can be merged to form a
66
+ # complete value as follows:
68
67
  #
69
68
  # * `bool/number/null`: cannot be chunked
70
69
  # * `string`: concatenate the strings
@@ -126,10 +125,9 @@ module Google
126
125
  # field value `"World" = "W" + "orl" + "d"`.
127
126
  # @!attribute [rw] chunked_value
128
127
  # @return [true, false]
129
- # If true, then the final value in
130
- # {Google::Spanner::V1::PartialResultSet#values values} is chunked, and must be
131
- # combined with more values from subsequent `PartialResultSet`s to obtain a
132
- # complete field value.
128
+ # If true, then the final value in {Google::Spanner::V1::PartialResultSet#values values} is chunked, and must
129
+ # be combined with more values from subsequent `PartialResultSet`s
130
+ # to obtain a complete field value.
133
131
  # @!attribute [rw] resume_token
134
132
  # @return [String]
135
133
  # Streaming calls might be interrupted for a variety of reasons, such
@@ -141,13 +139,13 @@ module Google
141
139
  # @return [Google::Spanner::V1::ResultSetStats]
142
140
  # Query plan and execution statistics for the statement that produced this
143
141
  # streaming result set. These can be requested by setting
144
- # {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode}
145
- # and are sent only once with the last response in the stream. This field
146
- # will also be present in the last response for DML statements.
142
+ # {Google::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest#query_mode} and are sent
143
+ # only once with the last response in the stream.
144
+ # This field will also be present in the last response for DML
145
+ # statements.
147
146
  class PartialResultSet; end
148
147
 
149
- # Metadata about a {Google::Spanner::V1::ResultSet ResultSet} or
150
- # {Google::Spanner::V1::PartialResultSet PartialResultSet}.
148
+ # Metadata about a {Google::Spanner::V1::ResultSet ResultSet} or {Google::Spanner::V1::PartialResultSet PartialResultSet}.
151
149
  # @!attribute [rw] row_type
152
150
  # @return [Google::Spanner::V1::StructType]
153
151
  # Indicates the field names and types for the rows in the result
@@ -164,12 +162,10 @@ module Google
164
162
  # information about the new transaction is yielded here.
165
163
  class ResultSetMetadata; end
166
164
 
167
- # Additional statistics about a {Google::Spanner::V1::ResultSet ResultSet} or
168
- # {Google::Spanner::V1::PartialResultSet PartialResultSet}.
165
+ # Additional statistics about a {Google::Spanner::V1::ResultSet ResultSet} or {Google::Spanner::V1::PartialResultSet PartialResultSet}.
169
166
  # @!attribute [rw] query_plan
170
167
  # @return [Google::Spanner::V1::QueryPlan]
171
- # {Google::Spanner::V1::QueryPlan QueryPlan} for the query associated with this
172
- # result.
168
+ # {Google::Spanner::V1::QueryPlan QueryPlan} for the query associated with this result.
173
169
  # @!attribute [rw] query_stats
174
170
  # @return [Google::Protobuf::Struct]
175
171
  # Aggregated statistics from the execution of the query. Only present when
@@ -138,30 +138,28 @@ module Google
138
138
  # For queries, if none is provided, the default is a temporary read-only
139
139
  # transaction with strong concurrency.
140
140
  #
141
- # Standard DML statements require a ReadWrite transaction. Single-use
142
- # transactions are not supported (to avoid replay). The caller must
143
- # either supply an existing transaction ID or begin a new transaction.
141
+ # Standard DML statements require a read-write transaction. To protect
142
+ # against replays, single-use transactions are not supported. The caller
143
+ # must either supply an existing transaction ID or begin a new transaction.
144
144
  #
145
- # Partitioned DML requires an existing PartitionedDml transaction ID.
145
+ # Partitioned DML requires an existing Partitioned DML transaction ID.
146
146
  # @!attribute [rw] sql
147
147
  # @return [String]
148
148
  # Required. The SQL string.
149
149
  # @!attribute [rw] params
150
150
  # @return [Google::Protobuf::Struct]
151
- # The SQL string can contain parameter placeholders. A parameter
152
- # placeholder consists of `'@'` followed by the parameter
153
- # name. Parameter names consist of any combination of letters,
154
- # numbers, and underscores.
151
+ # Parameter names and values that bind to placeholders in the SQL string.
152
+ #
153
+ # A parameter placeholder consists of the `@` character followed by the
154
+ # parameter name (for example, `@firstName`). Parameter names can contain
155
+ # letters, numbers, and underscores.
155
156
  #
156
157
  # Parameters can appear anywhere that a literal value is expected. The same
157
158
  # parameter name can be used more than once, for example:
158
- # `"WHERE id > @msg_id AND id < @msg_id + 100"`
159
159
  #
160
- # It is an error to execute an SQL statement with unbound parameters.
160
+ # `"WHERE id > @msg_id AND id < @msg_id + 100"`
161
161
  #
162
- # Parameter values are specified using `params`, which is a JSON
163
- # object whose keys are parameter names, and whose values are the
164
- # corresponding parameter values.
162
+ # It is an error to execute a SQL statement with unbound parameters.
165
163
  # @!attribute [rw] param_types
166
164
  # @return [Hash{String => Google::Spanner::V1::Type}]
167
165
  # It is not always possible for Cloud Spanner to infer the right SQL type
@@ -197,7 +195,7 @@ module Google
197
195
  # PartitionQueryRequest message used to create this partition_token.
198
196
  # @!attribute [rw] seqno
199
197
  # @return [Integer]
200
- # A per-transaction sequence number used to identify this request. This
198
+ # A per-transaction sequence number used to identify this request. This field
201
199
  # makes each request idempotent such that if the request is received multiple
202
200
  # times, at most one will succeed.
203
201
  #
@@ -223,29 +221,35 @@ module Google
223
221
  end
224
222
  end
225
223
 
226
- # The request for {Google::Spanner::V1::Spanner::ExecuteBatchDml ExecuteBatchDml}
224
+ # The request for {Google::Spanner::V1::Spanner::ExecuteBatchDml ExecuteBatchDml}.
227
225
  # @!attribute [rw] session
228
226
  # @return [String]
229
227
  # Required. The session in which the DML statements should be performed.
230
228
  # @!attribute [rw] transaction
231
229
  # @return [Google::Spanner::V1::TransactionSelector]
232
- # The transaction to use. A ReadWrite transaction is required. Single-use
233
- # transactions are not supported (to avoid replay). The caller must either
234
- # supply an existing transaction ID or begin a new transaction.
230
+ # Required. The transaction to use. Must be a read-write transaction.
231
+ #
232
+ # To protect against replays, single-use transactions are not supported. The
233
+ # caller must either supply an existing transaction ID or begin a new
234
+ # transaction.
235
235
  # @!attribute [rw] statements
236
236
  # @return [Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement>]
237
- # The list of statements to execute in this batch. Statements are executed
238
- # serially, such that the effects of statement i are visible to statement
239
- # i+1. Each statement must be a DML statement. Execution will stop at the
240
- # first failed statement; the remaining statements will not run.
237
+ # Required. The list of statements to execute in this batch. Statements are
238
+ # executed serially, such that the effects of statement `i` are visible to
239
+ # statement `i+1`. Each statement must be a DML statement. Execution stops at
240
+ # the first failed statement; the remaining statements are not executed.
241
241
  #
242
- # REQUIRES: statements_size() > 0.
242
+ # Callers must provide at least one statement.
243
243
  # @!attribute [rw] seqno
244
244
  # @return [Integer]
245
- # A per-transaction sequence number used to identify this request. This is
246
- # used in the same space as the seqno in
247
- # {Spanner::ExecuteSqlRequest ExecuteSqlRequest}. See more details
248
- # in {Spanner::ExecuteSqlRequest ExecuteSqlRequest}.
245
+ # Required. A per-transaction sequence number used to identify this request.
246
+ # This field makes each request idempotent such that if the request is
247
+ # received multiple times, at most one will succeed.
248
+ #
249
+ # The sequence number must be monotonically increasing within the
250
+ # transaction. If a request arrives for the first time with an out-of-order
251
+ # sequence number, the transaction may be aborted. Replays of previously
252
+ # handled requests will yield the same response as the first execution.
249
253
  class ExecuteBatchDmlRequest
250
254
  # A single DML statement.
251
255
  # @!attribute [rw] sql
@@ -253,20 +257,18 @@ module Google
253
257
  # Required. The DML string.
254
258
  # @!attribute [rw] params
255
259
  # @return [Google::Protobuf::Struct]
256
- # The DML string can contain parameter placeholders. A parameter
257
- # placeholder consists of `'@'` followed by the parameter
258
- # name. Parameter names consist of any combination of letters,
259
- # numbers, and underscores.
260
+ # Parameter names and values that bind to placeholders in the DML string.
261
+ #
262
+ # A parameter placeholder consists of the `@` character followed by the
263
+ # parameter name (for example, `@firstName`). Parameter names can contain
264
+ # letters, numbers, and underscores.
260
265
  #
261
266
  # Parameters can appear anywhere that a literal value is expected. The
262
267
  # same parameter name can be used more than once, for example:
263
- # `"WHERE id > @msg_id AND id < @msg_id + 100"`
264
268
  #
265
- # It is an error to execute an SQL statement with unbound parameters.
269
+ # `"WHERE id > @msg_id AND id < @msg_id + 100"`
266
270
  #
267
- # Parameter values are specified using `params`, which is a JSON
268
- # object whose keys are parameter names, and whose values are the
269
- # corresponding parameter values.
271
+ # It is an error to execute a SQL statement with unbound parameters.
270
272
  # @!attribute [rw] param_types
271
273
  # @return [Hash{String => Google::Spanner::V1::Type}]
272
274
  # It is not always possible for Cloud Spanner to infer the right SQL type
@@ -284,39 +286,49 @@ module Google
284
286
 
285
287
  # The response for
286
288
  # {Google::Spanner::V1::Spanner::ExecuteBatchDml ExecuteBatchDml}. Contains a list
287
- # of {Google::Spanner::V1::ResultSet ResultSet}, one for each DML statement that
288
- # has successfully executed. If a statement fails, the error is returned as
289
- # part of the response payload. Clients can determine whether all DML
290
- # statements have run successfully, or if a statement failed, using one of the
291
- # following approaches:
292
- #
293
- # 1. Check if 'status' field is OkStatus.
294
- # 2. Check if result_sets_size() equals the number of statements in
295
- # {Spanner::ExecuteBatchDmlRequest ExecuteBatchDmlRequest}.
296
- #
297
- # Example 1: A request with 5 DML statements, all executed successfully.
298
- # Result: A response with 5 ResultSets, one for each statement in the same
299
- # order, and an OK status.
300
- #
301
- # Example 2: A request with 5 DML statements. The 3rd statement has a syntax
302
- # error.
303
- # Result: A response with 2 ResultSets, for the first 2 statements that
304
- # run successfully, and a syntax error (INVALID_ARGUMENT) status. From
305
- # result_set_size() client can determine that the 3rd statement has failed.
289
+ # of {Google::Spanner::V1::ResultSet ResultSet} messages, one for each DML
290
+ # statement that has successfully executed, in the same order as the statements
291
+ # in the request. If a statement fails, the status in the response body
292
+ # identifies the cause of the failure.
293
+ #
294
+ # To check for DML statements that failed, use the following approach:
295
+ #
296
+ # 1. Check the status in the response message. The
297
+ # {Google::Rpc::Code} enum
298
+ # value `OK` indicates that all statements were executed successfully.
299
+ # 2. If the status was not `OK`, check the number of result sets in the
300
+ # response. If the response contains `N`
301
+ # {Google::Spanner::V1::ResultSet ResultSet} messages, then statement `N+1` in
302
+ # the request failed.
303
+ #
304
+ # Example 1:
305
+ #
306
+ # * Request: 5 DML statements, all executed successfully.
307
+ # * Response: 5 {Google::Spanner::V1::ResultSet ResultSet} messages, with the
308
+ # status `OK`.
309
+ #
310
+ # Example 2:
311
+ #
312
+ # * Request: 5 DML statements. The third statement has a syntax error.
313
+ # * Response: 2 {Google::Spanner::V1::ResultSet ResultSet} messages, and a syntax
314
+ # error (`INVALID_ARGUMENT`)
315
+ # status. The number of {Google::Spanner::V1::ResultSet ResultSet} messages
316
+ # indicates that the third statement failed, and the fourth and fifth
317
+ # statements were not executed.
306
318
  # @!attribute [rw] result_sets
307
319
  # @return [Array<Google::Spanner::V1::ResultSet>]
308
- # ResultSets, one for each statement in the request that ran successfully, in
309
- # the same order as the statements in the request. Each
310
- # {Google::Spanner::V1::ResultSet ResultSet} will not contain any rows. The
311
- # {Google::Spanner::V1::ResultSetStats ResultSetStats} in each
312
- # {Google::Spanner::V1::ResultSet ResultSet} will contain the number of rows
320
+ # One {Google::Spanner::V1::ResultSet ResultSet} for each statement in the
321
+ # request that ran successfully, in the same order as the statements in the
322
+ # request. Each {Google::Spanner::V1::ResultSet ResultSet} does not contain any
323
+ # rows. The {Google::Spanner::V1::ResultSetStats ResultSetStats} in each
324
+ # {Google::Spanner::V1::ResultSet ResultSet} contain the number of rows
313
325
  # modified by the statement.
314
326
  #
315
- # Only the first ResultSet in the response contains a valid
316
- # {Google::Spanner::V1::ResultSetMetadata ResultSetMetadata}.
327
+ # Only the first {Google::Spanner::V1::ResultSet ResultSet} in the response
328
+ # contains valid {Google::Spanner::V1::ResultSetMetadata ResultSetMetadata}.
317
329
  # @!attribute [rw] status
318
330
  # @return [Google::Rpc::Status]
319
- # If all DML statements are executed successfully, status will be OK.
331
+ # If all DML statements are executed successfully, the status is `OK`.
320
332
  # Otherwise, the error status of the first failed statement.
321
333
  class ExecuteBatchDmlResponse; end
322
334
 
@@ -352,8 +364,8 @@ module Google
352
364
  # transactions are not.
353
365
  # @!attribute [rw] sql
354
366
  # @return [String]
355
- # The query request to generate partitions for. The request will fail if
356
- # the query is not root partitionable. The query plan of a root
367
+ # Required. The query request to generate partitions for. The request will
368
+ # fail if the query is not root partitionable. The query plan of a root
357
369
  # partitionable query has a single distributed union operator. A distributed
358
370
  # union operator conceptually divides one or more tables into multiple
359
371
  # splits, remotely evaluates a subquery independently on each split, and
@@ -365,20 +377,18 @@ module Google
365
377
  # PartitionedDml transaction for large, partition-friendly DML operations.
366
378
  # @!attribute [rw] params
367
379
  # @return [Google::Protobuf::Struct]
368
- # The SQL query string can contain parameter placeholders. A parameter
369
- # placeholder consists of `'@'` followed by the parameter
370
- # name. Parameter names consist of any combination of letters,
371
- # numbers, and underscores.
380
+ # Parameter names and values that bind to placeholders in the SQL string.
381
+ #
382
+ # A parameter placeholder consists of the `@` character followed by the
383
+ # parameter name (for example, `@firstName`). Parameter names can contain
384
+ # letters, numbers, and underscores.
372
385
  #
373
386
  # Parameters can appear anywhere that a literal value is expected. The same
374
387
  # parameter name can be used more than once, for example:
375
- # `"WHERE id > @msg_id AND id < @msg_id + 100"`
376
388
  #
377
- # It is an error to execute an SQL query with unbound parameters.
389
+ # `"WHERE id > @msg_id AND id < @msg_id + 100"`
378
390
  #
379
- # Parameter values are specified using `params`, which is a JSON
380
- # object whose keys are parameter names, and whose values are the
381
- # corresponding parameter values.
391
+ # It is an error to execute a SQL statement with unbound parameters.
382
392
  # @!attribute [rw] param_types
383
393
  # @return [Hash{String => Google::Spanner::V1::Type}]
384
394
  # It is not always possible for Cloud Spanner to infer the right SQL type
@@ -476,8 +486,8 @@ module Google
476
486
  # information.
477
487
  # @!attribute [rw] columns
478
488
  # @return [Array<String>]
479
- # The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned
480
- # for each row matching this request.
489
+ # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be
490
+ # returned for each row matching this request.
481
491
  # @!attribute [rw] key_set
482
492
  # @return [Google::Spanner::V1::KeySet]
483
493
  # Required. `key_set` identifies the rows to be yielded. `key_set` names the