feat(firestore): add databaseId configuration option#966
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a databaseId plugin configuration option to allow selecting a non-default Firestore database instance on native platforms (Android/iOS), aligning the plugin with Firestore multi-database use cases described in #661.
Changes:
- Extend Capacitor plugin config typings to include
FirebaseFirestore.databaseId. - Introduce platform-specific
FirebaseFirestoreConfigcontainers and pass config into the native implementations. - Route iOS/Android Firestore access through a helper that selects the default vs configured database instance.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/firestore/src/definitions.ts | Adds Capacitor CLI config typings for FirebaseFirestore.databaseId. |
| packages/firestore/ios/Plugin/FirebaseFirestorePlugin.swift | Builds and passes a FirebaseFirestoreConfig from Capacitor config into the implementation. |
| packages/firestore/ios/Plugin/FirebaseFirestoreConfig.swift | New config struct holding databaseId. |
| packages/firestore/ios/Plugin/FirebaseFirestore.swift | Uses a helper to pick the Firestore instance based on databaseId for all operations. |
| packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestorePlugin.java | Reads config and passes it into the Android implementation. |
| packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestoreConfig.java | New config class holding databaseId. |
| packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestore.java | Selects Firestore instance based on databaseId. |
| .changeset/bright-foxes-dance.md | Adds a changeset entry for the new configuration option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...id/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestore.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
databaseIdplugin configuration option to support non-default Firestore databasesFirebaseFirestoreConfigclass/struct on Android and iOS following the existing conventionClose #661