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

Add import/export support to Realtime Database #2429

Merged
merged 11 commits into from
Jul 7, 2020
Merged

Conversation

samtstern
Copy link
Contributor

@samtstern samtstern commented Jul 6, 2020

Description

Fixes #2079

TODO:

  • Automated testing
  • Multi ns support for export
  • Filter null exports

Scenarios Tested

To test:

  • Import/export a single namespace
  • Import/export multiple namespaces

Sample Commands

N/A

@googlebot googlebot added the cla: yes Manual indication that this has passed CLA. label Jul 6, 2020
@samtstern samtstern marked this pull request as ready for review July 6, 2020 17:57
@samtstern samtstern requested a review from yuchenshi July 6, 2020 17:58
src/emulator/hubExport.ts Outdated Show resolved Hide resolved
src/emulator/hubExport.ts Outdated Show resolved Hide resolved
src/emulator/controller.ts Outdated Show resolved Hide resolved
src/emulator/controller.ts Outdated Show resolved Hide resolved
.refFromURL(`http:https://localhost:${config.emulators!.database.port}/?ns=namespace-b`);
await bRef.set({
ns: "namespace-b",
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we also try to read from (but not write to) namespace-c and assert that namespace-c is not exported?

Copy link
Contributor Author

@samtstern samtstern Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

@samtstern
Copy link
Contributor Author

samtstern commented Jul 6, 2020

Tests pass on my machine but in CI:

  1) import/export end to end
       should be able to import/export rtdb data:
     Error: failed to resolve startup before process.stdout closed
      at Socket.customFailure (scripts/integration-helpers/cli.ts:46:18)
      at Pipe._handle.close [as _onclose] (net.js:561:12)

@bkendall I think you wrote that error msg, any idea?

EDIT: I think this is an issue with http and Node 8:
jamhall/s3rver#438

@samtstern samtstern merged commit ba06f6d into master Jul 7, 2020
@bkendall bkendall deleted the ss-rtdb-import-export branch August 4, 2021 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tracking] Add import/export support to RTDB emulator
3 participants