firebase / firebase-admin-go

Firebase Admin Go SDK
Apache License 2.0
1.12k stars 239 forks source link

feat(app): allow configuring firestore instance id #631

Open aexvir opened 3 weeks ago

aexvir commented 3 weeks ago

👋🏻 hey there I'm trying to use the firebase sdk for my app but I'm not using the default (default) firestore db instance, which seems to be the only supported option by this sdk

this mr introduces a new option, firestoreID configurable like the others, via json or via explicit values in the Config struct, and passes this value to the NewClientWithDatabase firestore constructor

if no value is supplied, the default db is still targeted, so this shouldn't incur any breaking change to existing users, moreover, there's no hardcoded values, I'm using the public variable exposed by the firestore package

I've also updated the tests to not only verify that the constructor succeeds, but also that the correct database is being used when e.g. building document refs

google-cla[bot] commented 3 weeks ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.