feat: new Firestore index modes and Database Editions

PiperOrigin-RevId: 745570206
This commit is contained in:
Google APIs 2025-04-09 06:54:34 -07:00 committed by Copybara-Service
parent 87e84cbd8c
commit 4ec607bd37
2 changed files with 76 additions and 0 deletions

View file

@ -227,6 +227,20 @@ message Database {
}
}
// The edition of the database.
enum DatabaseEdition {
// Not used.
DATABASE_EDITION_UNSPECIFIED = 0;
// Standard edition.
//
// This is the default setting if not specified.
STANDARD = 1;
// Enterprise edition.
ENTERPRISE = 2;
}
// The resource name of the Database.
// Format: `projects/{project}/databases/{database}`
string name = 1;
@ -314,8 +328,25 @@ message Database {
// Output only. Information about the provenance of this database.
SourceInfo source_info = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Background: Free tier is the ability of a Firestore database
// to use a small amount of resources every day without being charged. Once
// usage exceeds the free tier limit further usage is charged.
//
// Whether this database can make use of the free tier. Only one database
// per project can be eligible for the free tier.
//
// The first (or next) database that is created in a project without a free
// tier database will be marked as eligible for the free tier. Databases that
// are created while there is a free tier database will not be eligible for
// the free tier.
optional bool free_tier = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
// This checksum is computed by the server based on the value of other
// fields, and may be sent on update and delete requests to ensure the
// client has an up-to-date value before proceeding.
string etag = 99;
// Immutable. The edition of the database.
DatabaseEdition database_edition = 28
[(google.api.field_behavior) = IMMUTABLE];
}

View file

@ -66,6 +66,9 @@ message Index {
// The index can only be used by the Firestore in Datastore Mode query API.
DATASTORE_MODE_API = 1;
// The index can only be used by the MONGODB_COMPATIBLE_API.
MONGODB_COMPATIBLE_API = 2;
}
// A field in an index.
@ -162,6 +165,32 @@ message Index {
NEEDS_REPAIR = 3;
}
// The density configuration for the index.
enum Density {
// Unspecified. It will use database default setting. This value is input
// only.
DENSITY_UNSPECIFIED = 0;
// In order for an index entry to be added, the document must
// contain all fields specified in the index.
//
// This is the only allowed value for indexes having ApiScope `ANY_API` and
// `DATASTORE_MODE_API`.
SPARSE_ALL = 1;
// In order for an index entry to be added, the document must
// contain at least one of the fields specified in the index.
// Non-existent fields are treated as having a NULL value when generating
// index entries.
SPARSE_ANY = 2;
// An index entry will be added regardless of whether the
// document contains any of the fields specified in the index.
// Non-existent fields are treated as having a NULL value when generating
// index entries.
DENSE = 3;
}
// Output only. A server defined name for this index.
// The form of this name for composite indexes will be:
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
@ -195,4 +224,20 @@ message Index {
// Output only. The serving state of the index.
State state = 4;
// Immutable. The density configuration of the index.
Density density = 6 [(google.api.field_behavior) = IMMUTABLE];
// Optional. Whether the index is multikey. By default, the index is not
// multikey. For non-multikey indexes, none of the paths in the index
// definition reach or traverse an array, except via an explicit array index.
// For multikey indexes, at most one of the paths in the index definition
// reach or traverse an array, except via an explicit array index. Violations
// will result in errors.
//
// Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
bool multikey = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. The number of shards for the index.
int32 shard_count = 8 [(google.api.field_behavior) = OPTIONAL];
}