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

Source: stdin / File

The stdin source reads line-delimited JSON from standard input or a file and delivers each line as a message into a pg_tide inbox. This is useful for testing, replay from log files, data migration, and piping output from external commands into your inbox.

Configuration

SELECT tide.relay_set_inbox(
    'file-import',
    'imported_events',
    '{
        "source_type": "stdin",
        "input_file": "/data/events-export.jsonl",
        "batch_size": 1000
    }'::jsonb
);

Configuration Reference

ParameterTypeDefaultDescription
source_typestringMust be "stdin"
input_filestringnullFile path (null = read from stdin)
batch_sizeint100Lines per inbox insert batch
formatstring"jsonl"Input format: "jsonl" (one JSON per line)

Use Cases

Replaying from a log file

pg-tide --postgres-url "..." < events-backup.jsonl

Piping from another tool

kafka-console-consumer --topic events --from-beginning | pg-tide --postgres-url "..."

Further Reading