kevlened/fireway

use with the firestore emulator

kiptoomm opened this issue · 3 comments

Is there any way to use this library against a local instance of firestore running in the emulator? I'd love to test migration scripts against my local instance running at http://localhost:4000/firestore but when I do:
fireway migrate

I get:

Found 2 migration files
ERROR: 9 FAILED_PRECONDITION: The Cloud Firestore API is not available for Cloud Datastore projects.

I thought that maybe it needs the --projectId option but I wouldn't know which 'project' to use since the target database is on a [locally] emulated instance. Any ideas?

There is! We do this to test fireway itself. fireway is built on the firestore node library. If you define FIRESTORE_EMULATOR_HOST like we do here, the firestore node library will connect to your local instance (source). You shouldn't need a --projectId.

There is! We do this to test fireway itself. fireway is built on the firestore node library. If you define FIRESTORE_EMULATOR_HOST like we do here, the firestore node library will connect to your local instance (source). You shouldn't need a --projectId.

Great, thank you! I went ahead and made a PR to improve the docs: #17

Thanks for the contribution!