Struct google_api_proto::google::spanner::v1::ExecuteBatchDmlResponse
source · pub struct ExecuteBatchDmlResponse {
pub result_sets: Vec<ResultSet>,
pub status: Option<Status>,
}
Expand description
The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML statement that has successfully executed, in the same order as the statements in the request. If a statement fails, the status in the response body identifies the cause of the failure.
To check for DML statements that failed, use the following approach:
- Check the status in the response message. The
[google.rpc.Code][google.rpc.Code] enum
value
OK
indicates that all statements were executed successfully. - If the status was not
OK
, check the number of result sets in the response. If the response containsN
[ResultSet][google.spanner.v1.ResultSet] messages, then statementN+1
in the request failed.
Example 1:
- Request: 5 DML statements, all executed successfully.
- Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the
status
OK
.
Example 2:
- Request: 5 DML statements. The third statement has a syntax error.
- Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax
error (
INVALID_ARGUMENT
) status. The number of [ResultSet][google.spanner.v1.ResultSet] messages indicates that the third statement failed, and the fourth and fifth statements were not executed.
Fields§
§result_sets: Vec<ResultSet>
One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain the number of rows modified by the statement.
Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
status: Option<Status>
If all DML statements are executed successfully, the status is OK
.
Otherwise, the error status of the first failed statement.
Trait Implementations§
source§impl Clone for ExecuteBatchDmlResponse
impl Clone for ExecuteBatchDmlResponse
source§fn clone(&self) -> ExecuteBatchDmlResponse
fn clone(&self) -> ExecuteBatchDmlResponse
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExecuteBatchDmlResponse
impl Debug for ExecuteBatchDmlResponse
source§impl Default for ExecuteBatchDmlResponse
impl Default for ExecuteBatchDmlResponse
source§impl Message for ExecuteBatchDmlResponse
impl Message for ExecuteBatchDmlResponse
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ExecuteBatchDmlResponse
impl PartialEq for ExecuteBatchDmlResponse
source§fn eq(&self, other: &ExecuteBatchDmlResponse) -> bool
fn eq(&self, other: &ExecuteBatchDmlResponse) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ExecuteBatchDmlResponse
Auto Trait Implementations§
impl Freeze for ExecuteBatchDmlResponse
impl RefUnwindSafe for ExecuteBatchDmlResponse
impl Send for ExecuteBatchDmlResponse
impl Sync for ExecuteBatchDmlResponse
impl Unpin for ExecuteBatchDmlResponse
impl UnwindSafe for ExecuteBatchDmlResponse
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request