Skip to main content

Module records

Module records 

Source
Expand description

TableRows/1 as JsonEvents/1: an array of records keyed by label.

A table has a natural JSON form, one object per row with the column labels as member names, and producing it as events rather than text means the JSON renderer, and every other JsonEvents/1 consumer, gets it for free. The stage retains the labels and nothing else: each row is emitted as it arrives and forgotten. Labels are data from the source’s metadata, so a repeated label is not an error here (the CSV renderer allows it too); it is resolved the way a JSON reader would resolve a repeated member in the un-deduplicated record, by keeping the last value that is there, and the output then carries each label once.

Structs§

RecordsToJson
Turns TableRows/1 into JsonEvents/1.

Enums§

MissingRecord
What a Cell::Missing becomes in a record.