Skip to main content

plan_import_op

Function plan_import_op 

Source
pub async fn plan_import_op(
    t: Option<&Transport>,
    path: &Path,
    overwrite: bool,
    skip_existing: bool,
) -> Result<ImportPlan>
Expand description

Compute the import preview and the NDJSON to upload.

The file is decoded as a bundle, never as rules only: decode_ndjson drops exception lines and would leave the operator with rules referencing lists that were never created. The preview counts containers and items, so an items-only file previews as the non-zero mutation it is. The transport is None unless skip_existing is set, so a dry run that only reads the file never needs a credential.