firebase-tools: Allow emulators to export on exit
Originally requested through FIrebase support, there is some demand for a flag like this:
firebase emulators:start --import=./seed --export-on-exit
This would import from a location but save any mutations made on exit.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 19 (14 by maintainers)
@michi88 thanks for asking all the right questions. My personal take:
I like the name
--export-on-exitI think it should take an optional path
--export-on-exit=./some-path. When unspecified it would use the same path as--import. If you do a bare--export-on-exitwith no--import=somethingflag that’s an error. So:emulators:start --import=./foo --export-on-exitemulators:start --import=./foo --export-on-exit=./baremulators:start --export-on-exit=./baremulators:start --export-on-exitIf that sounds good to you I’ll propose it to the API people.
Waiting with anticipation. I didn’t realise that data was not saved automatically after restarting and was wondering what was wrong with my app until I checked the db, I’m glad I’m not crazy.
@michi88 totally makes sense, although right now we do want import and export to feel explicit and separate for the reason you said: they’re one-time expensive operations. Something like
--data-dirimplies that these emulators have a persistence layer, which they do not.I’ll go ahead and kick this off.