Skip to main content

Module export

Module export 

Source
Expand description

The official emulator’s export format (Cloud Datastore’s managed export), byte for byte.

An export named N is a directory N/ holding:

  • N.overall_export_metadata: a log of two records, the version byte 0x33 and an OverallExportMetadata message pointing at each kind directory’s metadata, with its entity count and output size; an empty export has no pointer and no kind directory;
  • all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata: a plain message with the export’s name, start and end time (microseconds), and its output files;
  • all_namespaces/all_kinds/output-0: a log with one entity per document.

docs/export-format.md describes every field; tests/fixtures/export_import.json in the hidane crate holds exports written by the official emulator.

Modules§

datastore
Datastore mode’s entities as App Engine EntityProtos, the records of an export the official emulator writes in --database-mode datastore-mode (tests/fixtures/datastore_export.json in the hidane crate).
entity
Documents as App Engine EntityProtos, the records of an export’s output-* files.
log
The LevelDB log format the export files are written in.

Structs§

ExportedDocument
A document as an export holds it.
Malformed
Malformed protobuf.
Pointer
An OverallExportMetadata pointer to a kind directory’s metadata.

Enums§

OverallError
Why an overall metadata file was refused.

Constants§

KIND_METADATA
Where the one kind directory’s metadata sits, relative to the export directory.
OUTPUT
The one output file, relative to the kind directory.
VERSION
The first record of an overall metadata file.

Functions§

export_metadata
The contents of a kind directory’s .export_metadata.
overall_metadata
The contents of {name}.overall_export_metadata.
parse_export_metadata
The output files a kind’s metadata lists, relative to its directory.
parse_overall_metadata
The kind metadata paths an overall metadata file points at, relative to its directory.