From b6714528956f3907b1ca4aded372592ef00d34d6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 07:14:23 -0600 Subject: [PATCH] feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore index (#1849) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore index PiperOrigin-RevId: 532955594 Source-Link: https://github.com/googleapis/googleapis/commit/b4bb0e2e2473016fedf9f8179db8cedad0b3ca5d Source-Link: https://github.com/googleapis/googleapis-gen/commit/57104e2a08b77d7c5f39eb5b972ce981d7822445 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTcxMDRlMmEwOGI3N2Q3YzVmMzllYjViOTcyY2U5ODFkNzgyMjQ0NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../google/firestore/admin/v1/index.proto | 32 +++++++++++++++---- dev/protos/google/protobuf/any.proto | 3 +- dev/protos/google/protobuf/descriptor.proto | 7 ++-- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dev/protos/google/firestore/admin/v1/index.proto b/dev/protos/google/firestore/admin/v1/index.proto index 54b5e7e87..2567da650 100644 --- a/dev/protos/google/firestore/admin/v1/index.proto +++ b/dev/protos/google/firestore/admin/v1/index.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,6 +50,21 @@ message Index { // against all collections that has the collection id specified by the // index. COLLECTION_GROUP = 2; + + // Include all the collections's ancestor in the index. Only available for + // Datastore Mode databases. + COLLECTION_RECURSIVE = 3; + } + + // API Scope defines the APIs (Firestore Native, or Firestore in + // Datastore Mode) that are supported for queries. + enum ApiScope { + // The index can only be used by the Firestore Native query API. + // This is the default. + ANY_API = 0; + + // The index can only be used by the Firestore in Datastore Mode query API. + DATASTORE_MODE_API = 1; } // A field in an index. @@ -138,14 +153,17 @@ message Index { // time, and that have the same collection id as this index. QueryScope query_scope = 2; + // The API scope supported by this index. + ApiScope api_scope = 5; + // The fields supported by this index. // - // For composite indexes, this is always 2 or more fields. - // The last field entry is always for the field path `__name__`. If, on - // creation, `__name__` was not specified as the last field, it will be added - // automatically with the same direction as that of the last field defined. If - // the final field in a composite index is not directional, the `__name__` - // will be ordered ASCENDING (unless explicitly specified). + // For composite indexes, this requires a minimum of 2 and a maximum of 100 + // fields. The last field entry is always for the field path `__name__`. If, + // on creation, `__name__` was not specified as the last field, it will be + // added automatically with the same direction as that of the last field + // defined. If the final field in a composite index is not directional, the + // `__name__` will be ordered ASCENDING (unless explicitly specified). // // For single field indexes, this will always be exactly one entry with a // field path equal to the field path of the associated field. diff --git a/dev/protos/google/protobuf/any.proto b/dev/protos/google/protobuf/any.proto index c89243178..eff44e509 100644 --- a/dev/protos/google/protobuf/any.proto +++ b/dev/protos/google/protobuf/any.proto @@ -149,7 +149,8 @@ message Any { // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. diff --git a/dev/protos/google/protobuf/descriptor.proto b/dev/protos/google/protobuf/descriptor.proto index 16c10a6c2..c994d4a7b 100644 --- a/dev/protos/google/protobuf/descriptor.proto +++ b/dev/protos/google/protobuf/descriptor.proto @@ -159,10 +159,9 @@ message ExtensionRangeOptions { optional bool repeated = 6; } - // go/protobuf-stripping-extension-declarations - // Like Metadata, but we use a repeated field to hold all extension - // declarations. This should avoid the size increases of transforming a large - // extension range into small ranges in generated binaries. + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; // The verification state of the extension range.