Class: Google::Apis::SpannerV1::ExecuteBatchDmlResponse
- Inherits:
-
Object
- Object
- Google::Apis::SpannerV1::ExecuteBatchDmlResponse
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/spanner_v1/classes.rb,
generated/google/apis/spanner_v1/representations.rb,
generated/google/apis/spanner_v1/representations.rb
Overview
The response for ExecuteBatchDml. Contains a list of ResultSet, one for each DML statement that has successfully executed. If a statement fails, the error is returned as part of the response payload. Clients can determine whether all DML statements have run successfully, or if a statement failed, using one of the following approaches:
- Check if
'status'
field isOkStatus
. - Check if
result_sets_size()
equals the number of statements in ExecuteBatchDmlRequest. Example 1: A request with 5 DML statements, all executed successfully. Result: A response with 5 ResultSets, one for each statement in the same order, and anOkStatus
. Example 2: A request with 5 DML statements. The 3rd statement has a syntax error. Result: A response with 2 ResultSets, for the first 2 statements that run successfully, and a syntax error (INVALID_ARGUMENT
) status. Fromresult_set_size()
client can determine that the 3rd statement has failed.
Instance Attribute Summary collapse
-
#result_sets ⇒ Array<Google::Apis::SpannerV1::ResultSet>
ResultSets, one for each statement in the request that ran successfully, in the same order as the statements in the request.
-
#status ⇒ Google::Apis::SpannerV1::Status
The
Status
type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ExecuteBatchDmlResponse
constructor
A new instance of ExecuteBatchDmlResponse.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ ExecuteBatchDmlResponse
Returns a new instance of ExecuteBatchDmlResponse
913 914 915 |
# File 'generated/google/apis/spanner_v1/classes.rb', line 913 def initialize(**args) update!(**args) end |
Instance Attribute Details
#result_sets ⇒ Array<Google::Apis::SpannerV1::ResultSet>
ResultSets, one for each statement in the request that ran successfully, in
the same order as the statements in the request. Each ResultSet will
not contain any rows. The ResultSetStats in each ResultSet will
contain the number of rows modified by the statement.
Only the first ResultSet in the response contains a valid
ResultSetMetadata.
Corresponds to the JSON property resultSets
901 902 903 |
# File 'generated/google/apis/spanner_v1/classes.rb', line 901 def result_sets @result_sets end |
#status ⇒ Google::Apis::SpannerV1::Status
The Status
type defines a logical error model that is suitable for
different programming environments, including REST APIs and RPC APIs. It is
used by gRPC. Each Status
message contains
three pieces of data: error code, error message, and error details.
You can find out more about this error model and how to work with it in the
API Design Guide.
Corresponds to the JSON property status
911 912 913 |
# File 'generated/google/apis/spanner_v1/classes.rb', line 911 def status @status end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
918 919 920 921 |
# File 'generated/google/apis/spanner_v1/classes.rb', line 918 def update!(**args) @result_sets = args[:result_sets] if args.key?(:result_sets) @status = args[:status] if args.key?(:status) end |