Skip to main content

write_csv

Function write_csv 

Source
pub fn write_csv(
    source: &dyn ExportSource,
    rules: &[RuleDef],
    dest: &Path,
) -> Result<ExportStats, CliError>
Expand description

Write nodes.csv and relationships.csv to dest, plus rules.jsonl when there are rules.

Two passes over the nodes, neither holding more than one: the first finds each property’s kind (a column holds one), the second writes the rows.

Manual edges only: a derived edge belongs to its rule and is made again when the rule is created, so importing rules.jsonl last restores it. Edges carry no properties, so relationships.csv has none.

The key column is :ID (the key is also stored as the property id, as mushroomdb import does) when every node has an id property equal to its key, and :KEY (the key only) otherwise, so that an import gives back exactly the properties the store had.