Install
cargo install faucet-cli --features sink-csv faucet init --sink csv
# Cargo.toml — use it as a library cargo add faucet-sink-csv
Starter config
sink:
type: csv
config:
path: "" # REQUIRED — Path to the output CSV file.
# delimiter: 44 # Field delimiter byte.
# write_headers: true # Whether to write a header row.
# append: false # Whether to append to an existing file.
# batch_size: 1000 # Records per upstream `StreamPage`.
# on_unknown_field: null # Policy for a record key that is not in the sink's frozen column set.
# compression: null # User-facing compression config.
Capabilities
| Delivery | At-least-once |
|---|---|
| Write modes | append |
| Exactly-once writes | No |
| Schema evolution | No |
| Scoped cleanup | No |
| Staged bulk load | No |
| Run rollback | No |
| Compression | Yes |
Config fields
| Field | Type | Default | Description |
|---|---|---|---|
pathrequired | string | — | Path to the output CSV file. |
delimiter | integer | 44 | Field delimiter byte. Defaults to b','. |
write_headers | boolean | true | Whether to write a header row. Defaults to true. |
append | boolean | false | Whether to append to an existing file. Defaults to false (truncates). |
batch_size | integer | 1000 | Records per upstream StreamPage. The CSV sink writes rows to disk one at a time inside a spawn_blocking task fronted by a buffered csv::Writer, so this field has **no behavioural impact** at the sink — it is exposed purely for config parity across every sink in the workspace. Defaults to DEFAULT_BATCH_SIZE. |
on_unknown_field | object | warn | What to do when a record contains a field that is not part of the frozen column set (the CSV header is fixed from the first batch and cannot be rewritten without rewriting the whole file). A field that first appears in a *later* batch — or in a later record once the header is already written — cannot be added to the header, so its value is dropped from the output. Defaults to OnUnknownField::Warn. |
compression | string | object | auto | Compression codec for the output file. Defaults to CompressionConfig::Auto — .gz / .zst suffix selects gzip / zstd. Requires the crate-local compression feature. |
Get started
Your first pipeline runs in five minutes.
Install the CLI, scaffold a config, and move real data — nothing external to stand up.
curl -LsSf https://github.com/faucet-hq/faucet-stream/releases/latest/download/faucet-cli-installer.sh | sh brew install faucet-hq/faucet-stream/faucet-cli