1- // Copyright 2025 Google LLC
1+ // Copyright 2026 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package google.firestore.admin.v1;
1818
1919import "google/api/field_behavior.proto" ;
2020import "google/api/resource.proto" ;
21+ import "google/firestore/admin/v1/realtime_updates.proto" ;
2122import "google/protobuf/duration.proto" ;
2223import "google/protobuf/timestamp.proto" ;
2324
@@ -65,20 +66,25 @@ message Database {
6566
6667 // Use optimistic concurrency control by default. This mode is available
6768 // for Cloud Firestore databases.
69+ //
70+ // This is the default setting for Cloud Firestore Enterprise Edition
71+ // databases.
6872 OPTIMISTIC = 1 ;
6973
7074 // Use pessimistic concurrency control by default. This mode is available
7175 // for Cloud Firestore databases.
7276 //
73- // This is the default setting for Cloud Firestore.
77+ // This is the default setting for Cloud Firestore Standard Edition
78+ // databases.
7479 PESSIMISTIC = 2 ;
7580
7681 // Use optimistic concurrency control with entity groups by default.
7782 //
78- // This is the only available mode for Cloud Datastore.
83+ // This mode is enabled for some databases that were automatically upgraded
84+ // from Cloud Datastore to Cloud Firestore with Datastore Mode.
7985 //
80- // This mode is also available for Cloud Firestore with Datastore Mode but
81- // is not recommended .
86+ // It is not recommended for any new databases, and not supported for
87+ // Firestore Native databases .
8288 OPTIMISTIC_WITH_ENTITY_GROUPS = 3 ;
8389 }
8490
@@ -189,7 +195,8 @@ message Database {
189195 // Encryption configuration for a new database being created from another
190196 // source.
191197 //
192- // The source could be a [Backup][google.firestore.admin.v1.Backup] .
198+ // The source could be a [Backup][google.firestore.admin.v1.Backup] or a
199+ // [PitrSnapshot][google.firestore.admin.v1.PitrSnapshot].
193200 message EncryptionConfig {
194201 // The configuration options for using Google default encryption.
195202 message GoogleDefaultEncryptionOptions {}
@@ -241,6 +248,18 @@ message Database {
241248 ENTERPRISE = 2 ;
242249 }
243250
251+ // The data access mode.
252+ enum DataAccessMode {
253+ // Not Used.
254+ DATA_ACCESS_MODE_UNSPECIFIED = 0 ;
255+
256+ // Accessing the database through the API is allowed.
257+ DATA_ACCESS_MODE_ENABLED = 1 ;
258+
259+ // Accessing the database through the API is disallowed.
260+ DATA_ACCESS_MODE_DISABLED = 2 ;
261+ }
262+
244263 // The resource name of the Database.
245264 // Format: `projects/{project}/databases/{database}`
246265 string name = 1 ;
@@ -274,6 +293,10 @@ message Database {
274293 DatabaseType type = 10 ;
275294
276295 // The concurrency control mode to use for this database.
296+ //
297+ // If unspecified in a CreateDatabase request, this will default based on the
298+ // database edition: Optimistic for Enterprise and Pessimistic for all other
299+ // databases.
277300 ConcurrencyMode concurrency_mode = 15 ;
278301
279302 // Output only. The period during which past versions of data are retained in
@@ -359,4 +382,22 @@ message Database {
359382 // Immutable. The edition of the database.
360383 DatabaseEdition database_edition = 28
361384 [(google.api.field_behavior ) = IMMUTABLE ];
385+
386+ // Immutable. The default Realtime Updates mode to use for this database.
387+ RealtimeUpdatesMode realtime_updates_mode = 31
388+ [(google.api.field_behavior ) = IMMUTABLE ];
389+
390+ // Optional. The Firestore API data access mode to use for this database. If
391+ // not set on write:
392+ // - the default value is DATA_ACCESS_MODE_DISABLED for Enterprise Edition.
393+ // - the default value is DATA_ACCESS_MODE_ENABLED for Standard Edition.
394+ DataAccessMode firestore_data_access_mode = 33
395+ [(google.api.field_behavior ) = OPTIONAL ];
396+
397+ // Optional. The MongoDB compatible API data access mode to use for this
398+ // database. If not set on write, the default value is
399+ // DATA_ACCESS_MODE_ENABLED for Enterprise Edition. The value is always
400+ // DATA_ACCESS_MODE_DISABLED for Standard Edition.
401+ DataAccessMode mongodb_compatible_data_access_mode = 34
402+ [(google.api.field_behavior ) = OPTIONAL ];
362403}
0 commit comments