Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Stdout Destination

Config block

destination:
  type: stdout

No additional fields required. Data is written directly to standard output.

When to use

  • Piping data to other tools (jq, duckdb, wc -l)
  • Quick previews without creating files
  • Integration with other CLI pipelines

Example: preview as CSV

# preview.yaml
source:
  type: postgres
  url_env: DATABASE_URL

exports:
  - name: preview
    query: "SELECT id, name, email FROM users LIMIT 100"
    mode: full
    format: csv
    compression: none               # no compression for stdout readability
    destination:
      type: stdout
rivet run --config preview.yaml | head -20

Example: pipe to DuckDB

rivet run --config export.yaml | duckdb -c "SELECT count(*) FROM read_csv('/dev/stdin')"

Example: pipe to jq (CSV → JSON lines)

rivet run --config export.yaml | csvjson | jq '.[] | select(.status == "active")'

Notes

  • Only one export can use type: stdout per config file (multiple exports would intermix output)
  • CSV output supports only compression: none — zstd/gzip on a CSV export is rejected at config load. For compressed (binary) stdout output use format: parquet; keep format: csv for human-readable output
  • Rivet streams to stdout without buffering the full result
  • Progress bars and log messages go to stderr, so they don’t interfere with piped data
  • --validate and --reconcile flags work normally — results are printed to stderr

Verify

rivet doctor --config preview.yaml

Output:

[OK]  Destination Stdout (streaming; no preflight needed)

(stdout is a streaming sink — doctor records the check but performs no write probe)