2 option go_package = "datastore";
8 message PropertyValue {
9 optional int64 int64Value = 1;
10 optional bool booleanValue = 2;
11 optional string stringValue = 3;
12 optional double doubleValue = 4;
14 optional group PointValue = 5 {
15 required double x = 6;
16 required double y = 7;
19 optional group UserValue = 8 {
20 required string email = 9;
21 required string auth_domain = 10;
22 optional string nickname = 11;
23 optional string federated_identity = 21;
24 optional string federated_provider = 22;
27 optional group ReferenceValue = 12 {
28 required string app = 13;
29 optional string name_space = 20;
30 repeated group PathElement = 14 {
31 required string type = 15;
32 optional int64 id = 16;
33 optional string name = 17;
58 GD_POSTALADDRESS = 12;
68 optional Meaning meaning = 1 [default = NO_MEANING];
69 optional string meaning_uri = 2;
71 required string name = 3;
73 required PropertyValue value = 5;
75 required bool multiple = 4;
77 optional bool searchable = 6 [default=false];
79 enum FtsTokenizationOption {
84 optional FtsTokenizationOption fts_tokenization_option = 8;
86 optional string locale = 9 [default = "en"];
90 repeated group Element = 1 {
91 required string type = 2;
92 optional int64 id = 3;
93 optional string name = 4;
98 required string app = 13;
99 optional string name_space = 20;
100 required Path path = 14;
104 required string email = 1;
105 required string auth_domain = 2;
106 optional string nickname = 3;
107 optional string federated_identity = 6;
108 optional string federated_provider = 7;
111 message EntityProto {
112 required Reference key = 13;
113 required Path entity_group = 16;
114 optional User owner = 17;
121 optional Kind kind = 4;
122 optional string kind_uri = 5;
124 repeated Property property = 14;
125 repeated Property raw_property = 15;
127 optional int32 rank = 18;
130 message CompositeProperty {
131 required int64 index_id = 1;
132 repeated string value = 2;
136 required string entity_type = 1;
137 required bool ancestor = 5;
138 repeated group Property = 2 {
139 required string name = 3;
144 optional Direction direction = 4 [default = ASCENDING];
148 message CompositeIndex {
149 required string app_id = 1;
150 required int64 id = 2;
151 required Index definition = 3;
159 required State state = 4;
161 optional bool only_use_if_required = 6 [default = false];
164 message IndexPostfix {
166 required string property_name = 1;
167 required PropertyValue value = 2;
170 repeated IndexValue index_value = 1;
172 optional Reference key = 2;
174 optional bool before = 3 [default=true];
177 message IndexPosition {
178 optional string key = 1;
180 optional bool before = 2 [default=true];
189 required int64 ts = 1;
192 message InternalHeader {
193 optional string qos = 1;
196 message Transaction {
197 optional InternalHeader header = 4;
198 required fixed64 handle = 1;
199 required string app = 2;
200 optional bool mark_changes = 3 [default = false];
204 optional InternalHeader header = 39;
206 required string app = 1;
207 optional string name_space = 29;
209 optional string kind = 3;
210 optional Reference ancestor = 17;
212 repeated group Filter = 4 {
215 LESS_THAN_OR_EQUAL = 2;
217 GREATER_THAN_OR_EQUAL = 4;
223 required Operator op = 6;
224 repeated Property property = 14;
227 optional string search_query = 8;
229 repeated group Order = 9 {
235 required string property = 10;
236 optional Direction direction = 11 [default = ASCENDING];
244 optional Hint hint = 18;
246 optional int32 count = 23;
248 optional int32 offset = 12 [default = 0];
250 optional int32 limit = 16;
252 optional CompiledCursor compiled_cursor = 30;
253 optional CompiledCursor end_compiled_cursor = 31;
255 repeated CompositeIndex composite_index = 19;
257 optional bool require_perfect_plan = 20 [default = false];
259 optional bool keys_only = 21 [default = false];
261 optional Transaction transaction = 22;
263 optional bool compile = 25 [default = false];
265 optional int64 failover_ms = 26;
267 optional bool strong = 32;
269 repeated string property_name = 33;
271 repeated string group_by_property_name = 34;
273 optional bool distinct = 24;
275 optional int64 min_safe_time_seconds = 35;
277 repeated string safe_replica_name = 36;
279 optional bool persist_offset = 37 [default=false];
282 message CompiledQuery {
283 required group PrimaryScan = 1 {
284 optional string index_name = 2;
286 optional string start_key = 3;
287 optional bool start_inclusive = 4;
288 optional string end_key = 5;
289 optional bool end_inclusive = 6;
291 repeated string start_postfix_value = 22;
292 repeated string end_postfix_value = 23;
294 optional int64 end_unapplied_log_timestamp_us = 19;
297 repeated group MergeJoinScan = 7 {
298 required string index_name = 8;
300 repeated string prefix_value = 9;
302 optional bool value_prefix = 20 [default=false];
305 optional Index index_def = 21;
307 optional int32 offset = 10 [default = 0];
309 optional int32 limit = 11;
311 required bool keys_only = 12;
313 repeated string property_name = 24;
315 optional int32 distinct_infix_size = 25;
317 optional group EntityFilter = 13 {
318 optional bool distinct = 14 [default=false];
320 optional string kind = 17;
321 optional Reference ancestor = 18;
325 message CompiledCursor {
326 optional group Position = 2 {
327 optional string start_key = 27;
329 repeated group IndexValue = 29 {
330 optional string property = 30;
331 required PropertyValue value = 31;
334 optional Reference key = 32;
336 optional bool start_inclusive = 28 [default=true];
341 required fixed64 cursor = 1;
343 optional string app = 2;
349 CONCURRENT_TRANSACTION = 2;
353 PERMISSION_DENIED = 6;
355 COMMITTED_BUT_STILL_APPLYING = 8;
356 CAPABILITY_DISABLED = 9;
357 TRY_ALTERNATE_BACKEND = 10;
358 SAFE_TIME_TOO_OLD = 11;
363 optional int32 index_writes = 1;
364 optional int32 index_write_bytes = 2;
365 optional int32 entity_writes = 3;
366 optional int32 entity_write_bytes = 4;
367 optional group CommitCost = 5 {
368 optional int32 requested_entity_puts = 6;
369 optional int32 requested_entity_deletes = 7;
371 optional int32 approximate_storage_delta = 8;
372 optional int32 id_sequence_updates = 9;
376 optional InternalHeader header = 6;
378 repeated Reference key = 1;
379 optional Transaction transaction = 2;
381 optional int64 failover_ms = 3;
383 optional bool strong = 4;
385 optional bool allow_deferred = 5 [default=false];
388 message GetResponse {
389 repeated group Entity = 1 {
390 optional EntityProto entity = 2;
391 optional Reference key = 4;
393 optional int64 version = 3;
396 repeated Reference deferred = 5;
398 optional bool in_order = 6 [default=true];
402 optional InternalHeader header = 11;
404 repeated EntityProto entity = 1;
405 optional Transaction transaction = 2;
406 repeated CompositeIndex composite_index = 3;
408 optional bool trusted = 4 [default = false];
410 optional bool force = 7 [default = false];
412 optional bool mark_changes = 8 [default = false];
413 repeated Snapshot snapshot = 9;
419 optional AutoIdPolicy auto_id_policy = 10 [default = CURRENT];
422 message PutResponse {
423 repeated Reference key = 1;
424 optional Cost cost = 2;
425 repeated int64 version = 3;
428 message TouchRequest {
429 optional InternalHeader header = 10;
431 repeated Reference key = 1;
432 repeated CompositeIndex composite_index = 2;
433 optional bool force = 3 [default = false];
434 repeated Snapshot snapshot = 9;
437 message TouchResponse {
438 optional Cost cost = 1;
441 message DeleteRequest {
442 optional InternalHeader header = 10;
444 repeated Reference key = 6;
445 optional Transaction transaction = 5;
447 optional bool trusted = 4 [default = false];
449 optional bool force = 7 [default = false];
451 optional bool mark_changes = 8 [default = false];
452 repeated Snapshot snapshot = 9;
455 message DeleteResponse {
456 optional Cost cost = 1;
457 repeated int64 version = 3;
460 message NextRequest {
461 optional InternalHeader header = 5;
463 required Cursor cursor = 1;
464 optional int32 count = 2;
466 optional int32 offset = 4 [default = 0];
468 optional bool compile = 3 [default = false];
471 message QueryResult {
472 optional Cursor cursor = 1;
474 repeated EntityProto result = 2;
476 optional int32 skipped_results = 7;
478 required bool more_results = 3;
480 optional bool keys_only = 4;
482 optional bool index_only = 9;
484 optional bool small_ops = 10;
486 optional CompiledQuery compiled_query = 5;
488 optional CompiledCursor compiled_cursor = 6;
490 repeated CompositeIndex index = 8;
492 repeated int64 version = 11;
495 message AllocateIdsRequest {
496 optional InternalHeader header = 4;
498 optional Reference model_key = 1;
500 optional int64 size = 2;
502 optional int64 max = 3;
504 repeated Reference reserve = 5;
507 message AllocateIdsResponse {
508 required int64 start = 1;
509 required int64 end = 2;
510 optional Cost cost = 3;
513 message CompositeIndices {
514 repeated CompositeIndex index = 1;
517 message AddActionsRequest {
518 optional InternalHeader header = 3;
520 required Transaction transaction = 1;
521 repeated Action action = 2;
524 message AddActionsResponse {
527 message BeginTransactionRequest {
528 optional InternalHeader header = 3;
530 required string app = 1;
531 optional bool allow_multiple_eg = 2 [default = false];
532 optional string database_id = 4;
534 enum TransactionMode {
539 optional TransactionMode mode = 5 [default = UNKNOWN];
541 optional Transaction previous_transaction = 7;
544 message CommitResponse {
545 optional Cost cost = 1;
547 repeated group Version = 3 {
548 required Reference root_entity_key = 4;
549 required int64 version = 5;