1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/spanner/v1/result_set.proto
6 import proto "github.com/golang/protobuf/proto"
9 import _ "google.golang.org/genproto/googleapis/api/annotations"
10 import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
12 // Reference imports to suppress errors if they are not otherwise used.
17 // Results from [Read][google.spanner.v1.Spanner.Read] or
18 // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
19 type ResultSet struct {
20 // Metadata about the result set, such as row type information.
21 Metadata *ResultSetMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
22 // Each element in `rows` is a row whose format is defined by
23 // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith element
24 // in each row matches the ith field in
25 // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements are
26 // encoded based on type as described
27 // [here][google.spanner.v1.TypeCode].
28 Rows []*google_protobuf1.ListValue `protobuf:"bytes,2,rep,name=rows" json:"rows,omitempty"`
29 // Query plan and execution statistics for the query that produced this
30 // result set. These can be requested by setting
31 // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode].
32 Stats *ResultSetStats `protobuf:"bytes,3,opt,name=stats" json:"stats,omitempty"`
35 func (m *ResultSet) Reset() { *m = ResultSet{} }
36 func (m *ResultSet) String() string { return proto.CompactTextString(m) }
37 func (*ResultSet) ProtoMessage() {}
38 func (*ResultSet) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
40 func (m *ResultSet) GetMetadata() *ResultSetMetadata {
47 func (m *ResultSet) GetRows() []*google_protobuf1.ListValue {
54 func (m *ResultSet) GetStats() *ResultSetStats {
61 // Partial results from a streaming read or SQL query. Streaming reads and
62 // SQL queries better tolerate large result sets, large rows, and large
63 // values, but are a little trickier to consume.
64 type PartialResultSet struct {
65 // Metadata about the result set, such as row type information.
66 // Only present in the first response.
67 Metadata *ResultSetMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
68 // A streamed result set consists of a stream of values, which might
69 // be split into many `PartialResultSet` messages to accommodate
70 // large rows and/or large values. Every N complete values defines a
71 // row, where N is equal to the number of entries in
72 // [metadata.row_type.fields][google.spanner.v1.StructType.fields].
74 // Most values are encoded based on type as described
75 // [here][google.spanner.v1.TypeCode].
77 // It is possible that the last value in values is "chunked",
78 // meaning that the rest of the value is sent in subsequent
79 // `PartialResultSet`(s). This is denoted by the [chunked_value][google.spanner.v1.PartialResultSet.chunked_value]
80 // field. Two or more chunked values can be merged to form a
81 // complete value as follows:
83 // * `bool/number/null`: cannot be chunked
84 // * `string`: concatenate the strings
85 // * `list`: concatenate the lists. If the last element in a list is a
86 // `string`, `list`, or `object`, merge it with the first element in
87 // the next list by applying these rules recursively.
88 // * `object`: concatenate the (field name, field value) pairs. If a
89 // field name is duplicated, then apply these rules recursively
90 // to merge the field values.
92 // Some examples of merging:
94 // # Strings are concatenated.
95 // "foo", "bar" => "foobar"
97 // # Lists of non-strings are concatenated.
98 // [2, 3], [4] => [2, 3, 4]
100 // # Lists are concatenated, but the last and first elements are merged
101 // # because they are strings.
102 // ["a", "b"], ["c", "d"] => ["a", "bc", "d"]
104 // # Lists are concatenated, but the last and first elements are merged
105 // # because they are lists. Recursively, the last and first elements
106 // # of the inner lists are merged because they are strings.
107 // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"]
109 // # Non-overlapping object fields are combined.
110 // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"}
112 // # Overlapping object fields are merged.
113 // {"a": "1"}, {"a": "2"} => {"a": "12"}
115 // # Examples of merging objects containing lists of strings.
116 // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]}
118 // For a more complete example, suppose a streaming SQL query is
119 // yielding a result set whose rows contain a single string
120 // field. The following `PartialResultSet`s might be yielded:
123 // "metadata": { ... }
124 // "values": ["Hello", "W"]
125 // "chunked_value": true
126 // "resume_token": "Af65..."
130 // "chunked_value": true
131 // "resume_token": "Bqp2..."
135 // "resume_token": "Zx1B..."
138 // This sequence of `PartialResultSet`s encodes two rows, one
139 // containing the field value `"Hello"`, and a second containing the
140 // field value `"World" = "W" + "orl" + "d"`.
141 Values []*google_protobuf1.Value `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"`
142 // If true, then the final value in [values][google.spanner.v1.PartialResultSet.values] is chunked, and must
143 // be combined with more values from subsequent `PartialResultSet`s
144 // to obtain a complete field value.
145 ChunkedValue bool `protobuf:"varint,3,opt,name=chunked_value,json=chunkedValue" json:"chunked_value,omitempty"`
146 // Streaming calls might be interrupted for a variety of reasons, such
147 // as TCP connection loss. If this occurs, the stream of results can
148 // be resumed by re-sending the original request and including
149 // `resume_token`. Note that executing any other transaction in the
150 // same session invalidates the token.
151 ResumeToken []byte `protobuf:"bytes,4,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"`
152 // Query plan and execution statistics for the query that produced this
153 // streaming result set. These can be requested by setting
154 // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent
155 // only once with the last response in the stream.
156 Stats *ResultSetStats `protobuf:"bytes,5,opt,name=stats" json:"stats,omitempty"`
159 func (m *PartialResultSet) Reset() { *m = PartialResultSet{} }
160 func (m *PartialResultSet) String() string { return proto.CompactTextString(m) }
161 func (*PartialResultSet) ProtoMessage() {}
162 func (*PartialResultSet) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
164 func (m *PartialResultSet) GetMetadata() *ResultSetMetadata {
171 func (m *PartialResultSet) GetValues() []*google_protobuf1.Value {
178 func (m *PartialResultSet) GetChunkedValue() bool {
180 return m.ChunkedValue
185 func (m *PartialResultSet) GetResumeToken() []byte {
192 func (m *PartialResultSet) GetStats() *ResultSetStats {
199 // Metadata about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet].
200 type ResultSetMetadata struct {
201 // Indicates the field names and types for the rows in the result
202 // set. For example, a SQL query like `"SELECT UserId, UserName FROM
203 // Users"` could return a `row_type` value like:
206 // { "name": "UserId", "type": { "code": "INT64" } },
207 // { "name": "UserName", "type": { "code": "STRING" } },
209 RowType *StructType `protobuf:"bytes,1,opt,name=row_type,json=rowType" json:"row_type,omitempty"`
210 // If the read or SQL query began a transaction as a side-effect, the
211 // information about the new transaction is yielded here.
212 Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"`
215 func (m *ResultSetMetadata) Reset() { *m = ResultSetMetadata{} }
216 func (m *ResultSetMetadata) String() string { return proto.CompactTextString(m) }
217 func (*ResultSetMetadata) ProtoMessage() {}
218 func (*ResultSetMetadata) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
220 func (m *ResultSetMetadata) GetRowType() *StructType {
227 func (m *ResultSetMetadata) GetTransaction() *Transaction {
234 // Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet].
235 type ResultSetStats struct {
236 // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this result.
237 QueryPlan *QueryPlan `protobuf:"bytes,1,opt,name=query_plan,json=queryPlan" json:"query_plan,omitempty"`
238 // Aggregated statistics from the execution of the query. Only present when
239 // the query is profiled. For example, a query could return the statistics as
243 // "rows_returned": "3",
244 // "elapsed_time": "1.22 secs",
245 // "cpu_time": "1.19 secs"
247 QueryStats *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=query_stats,json=queryStats" json:"query_stats,omitempty"`
250 func (m *ResultSetStats) Reset() { *m = ResultSetStats{} }
251 func (m *ResultSetStats) String() string { return proto.CompactTextString(m) }
252 func (*ResultSetStats) ProtoMessage() {}
253 func (*ResultSetStats) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
255 func (m *ResultSetStats) GetQueryPlan() *QueryPlan {
262 func (m *ResultSetStats) GetQueryStats() *google_protobuf1.Struct {
270 proto.RegisterType((*ResultSet)(nil), "google.spanner.v1.ResultSet")
271 proto.RegisterType((*PartialResultSet)(nil), "google.spanner.v1.PartialResultSet")
272 proto.RegisterType((*ResultSetMetadata)(nil), "google.spanner.v1.ResultSetMetadata")
273 proto.RegisterType((*ResultSetStats)(nil), "google.spanner.v1.ResultSetStats")
276 func init() { proto.RegisterFile("google/spanner/v1/result_set.proto", fileDescriptor3) }
278 var fileDescriptor3 = []byte{
279 // 482 bytes of a gzipped FileDescriptorProto
280 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcb, 0x6e, 0x13, 0x31,
281 0x14, 0x86, 0x35, 0xe9, 0x85, 0xd4, 0x13, 0x10, 0xb5, 0x04, 0x1d, 0x45, 0x05, 0xa5, 0x29, 0x8b,
282 0xac, 0x3c, 0x4a, 0x59, 0x10, 0xa9, 0x9b, 0xaa, 0x2c, 0xd8, 0x80, 0x14, 0x9c, 0xa8, 0x0b, 0x36,
283 0xa3, 0xd3, 0xc4, 0x0c, 0xa3, 0x3a, 0xf6, 0xd4, 0xf6, 0x24, 0xca, 0x82, 0x25, 0x62, 0xc9, 0x7b,
284 0xf0, 0x00, 0x3c, 0x1f, 0xf2, 0x25, 0x17, 0x98, 0x08, 0x09, 0xa9, 0x3b, 0xc7, 0xfe, 0xfe, 0xf3,
285 0x9f, 0xff, 0xcc, 0x09, 0xea, 0xe6, 0x52, 0xe6, 0x9c, 0xa5, 0xba, 0x04, 0x21, 0x98, 0x4a, 0xe7,
286 0xfd, 0x54, 0x31, 0x5d, 0x71, 0x93, 0x69, 0x66, 0x48, 0xa9, 0xa4, 0x91, 0xf8, 0xd8, 0x33, 0x24,
287 0x30, 0x64, 0xde, 0x6f, 0x9f, 0x06, 0x19, 0x94, 0x45, 0x0a, 0x42, 0x48, 0x03, 0xa6, 0x90, 0x42,
288 0x7b, 0xc1, 0xfa, 0xd5, 0xfd, 0xba, 0xad, 0x3e, 0xa7, 0xda, 0xa8, 0x6a, 0x12, 0xca, 0xb5, 0x77,
289 0x58, 0xde, 0x57, 0x4c, 0x2d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