Skip to content

Commit a23710e

Browse files
committed
refactor(firestore): standalone googleapis_firestore package and multi-db support for firestore (#121)
* docs: update documentation link for sending messages to topic conditions * refactor: update constructors to use internal factory methods for AppCheck, Auth, Firestore, Messaging, and SecurityRules * update README * wip refactor google_cloud_firestore into its own package * wip refactor google_cloud_firestore files to streamline package structure * refactor: rename files and update imports for googleapis_firestore package * docs: add googleapis_firestore package documentation section to index.html * feat: add multi-database support to Firestore This change refactors the Firestore integration to support multiple databases within a single `FirebaseApp`, similar to the Node.js Admin SDK. Key changes: - `app.firestore()` now accepts an optional `databaseId` to get or create a named database instance. - Database instances are cached per `databaseId` to ensure the same instance is returned on subsequent calls. - The `Firestore` service wrapper now manages multiple `googleapis_firestore.Firestore` delegates, one for each database ID. - Settings are now passed during initialization via `app.firestore(settings: ...)`, and re-initialization with different settings is prevented. - Added comprehensive unit and integration tests for multi-database functionality, CRUD operations, and emulator support. - Refactored `EmulatorClient` into the `googleapis_firestore` package and removed redundant exception handling code. * docs: update README.md with Firestore usage examples and corrections * chore: fix lint errors * feat: enhance Firestore example with multi-database support and usage scenarios * feat: add googleapis_firestore dependency to pubspec.yaml * feat: add failedPrecondition error code and update error messages in Firestore * chore: comment out local Firestore emulator configuration in coverage script * refactor(firestore): simplify and improve firestore tests
1 parent dfbe31e commit a23710e

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

packages/googleapis_firestore/lib/src/bulk_writer.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,3 +912,4 @@ class BulkWriter {
912912
_bulkCommitBatch = _BulkCommitBatch(firestore, size);
913913
}
914914
}
915+

packages/googleapis_firestore/lib/src/firestore.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import 'package:http/http.dart'
1414
show BaseRequest, StreamedResponse, ByteStream, BaseClient, Client;
1515
import 'package:intl/intl.dart';
1616
import 'package:meta/meta.dart';
17+
1718
import 'backoff.dart';
1819
import 'environment.dart';
1920

packages/googleapis_firestore/lib/src/rate_limiter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,4 @@ class RateLimiter {
115115
@visibleForTesting
116116
int get maximumCapacity => _maximumCapacity;
117117
}
118+

0 commit comments

Comments
 (0)