payload-migrate

command
v0.9.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command payload-migrate backfills a JSONL file-backend payload dump (relay-payloads.jsonl) into the ClickHouse payload_logs table, so historical request/response bodies become queryable through the same reader the relay uses — after which the multi-GB local file can be deleted.

It reuses payload.Record, so the file's base64-encoded bodies decode to raw bytes and the RFC3339 timestamp parses natively; rows are appended in the exact column order the live ClickHouse sink and reader use, guaranteeing the migrated rows are readable via the relay's payload Get/List.

One-shot and resumable: every request_id already present in payload_logs is loaded up front and skipped, so re-running after an interruption only inserts the remainder (and never double-inserts). Bodies are MB-scale, so inserts flush on a byte budget as well as a row count.

go run ./cmd/payload-migrate -file relay-payloads.jsonl   # DSN from $RELAY_CH_DSN

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL