Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on how to use with Firebase Firestore emulators #583

Open
jackatomix opened this issue Dec 20, 2023 · 2 comments
Open

Documentation on how to use with Firebase Firestore emulators #583

jackatomix opened this issue Dec 20, 2023 · 2 comments
Labels
P3 question Further information is requested

Comments

@jackatomix
Copy link

We have an app that uses a Firestore database, and locally we can use the Firestore Firebase emulators provided by firebase-tools to avoid connecting to a remote/shared database.

It's clear enough on how to connect to the emulators locally for reading/writing data with @google-cloud/firestore, and it's also clear how I can deploy a function built with the Functions Framework that is triggered by a Firestore event. What I'm not clear on is how we can trigger a function built with the Functions Framework when data is written to said Firestore emulator.

Is this something that can be achieved with the Functions Framework, and if so, how does it need to be set up?

@HKWinterhalter HKWinterhalter added question Further information is requested P3 labels Dec 21, 2023
@HKWinterhalter
Copy link
Contributor

Hi @jackatomix, it sounds like this is a question for the firebase-tools owners. I was able to find some guides that may be related: https://firebase.google.com/docs/functions/local-emulator and https://firebase.google.com/docs/functions/local-shell.

@jackatomix
Copy link
Author

Hi @jackatomix, it sounds like this is a question for the firebase-tools owners. I was able to find some guides that may be related: https://firebase.google.com/docs/functions/local-emulator and https://firebase.google.com/docs/functions/local-shell.

Thanks @HKWinterhalter, I agree this is a bit of a grey area. I asked the question here as there is documentation in this repo on how to trigger functions from the Pub/Sub emulator, and I figure this is a similar use case. In fact, I think I'm asking about pretty much the same solution as was in #101 .

The documentation you've provided doesn't seem related to the Firestore emulator, more for the more general Firebase Functions abstraction. We do actually use those tools for other areas of the app, and local development is just fine with it. But for reasons that aren't important to this ticket, we'd like to avoid using it going forward.

The best I can tell what I'd like isn't explicitly a supported option between firebase-tools and the Functions Framework. I think the correct solution is for firebase-tools to allow sending a CloudEvent out via the Eventarc emulator to the function running from the Functions Framework, but that would add some additional complications.

@HKWinterhalter HKWinterhalter removed their assignment May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants