AshCsvInterchange.Import.RunReport (AshCsvInterchange v0.1.0)

Copy Markdown View Source

Structured result of a CSV import run.

counts is exact over every row. outcomes is a bounded preview — the first :max_outcomes row outcomes (default 100); outcomes_truncated? is true when more rows were processed than retained. Callers needing every per-row outcome should use AshCsvInterchange.stream_import/3 and fold the lazy stream themselves.

Summary

Functions

Builds a Counts struct from a list of outcomes.

Folds a single outcome into a Counts accumulator. Public so callers folding a stream_import/3 outcome stream can build the same aggregate that the bounded import_csv/3 report uses.

Types

t()

@type t() :: %AshCsvInterchange.Import.RunReport{
  counts: AshCsvInterchange.Import.RunReport.Counts.t(),
  input_keys: %{required(String.t()) => atom()},
  mode: :dry_run | :commit,
  outcomes: [AshCsvInterchange.Import.RowOutcome.t()],
  outcomes_truncated?: boolean(),
  resource: module(),
  source_headers: [String.t()],
  type_id: atom(),
  warnings: [AshCsvInterchange.Error.t()]
}

Functions

counts_from_outcomes(outcomes, blank_rows_skipped)

Builds a Counts struct from a list of outcomes.

tally(counts, outcome)

Folds a single outcome into a Counts accumulator. Public so callers folding a stream_import/3 outcome stream can build the same aggregate that the bounded import_csv/3 report uses.