Skip to main content
Version: v0.3.0

CLI

The sydradb binary provides a small command surface. When invoked with no arguments, it runs the HTTP server.

Implementation reference:

serve (default)

./zig-out/bin/sydradb
./zig-out/bin/sydradb serve

Loads sydradb.toml from the current working directory and starts the HTTP server.

Implementation: server.run dispatch.

pgwire [address] [port]

Starts the PostgreSQL wire protocol listener.

./zig-out/bin/sydradb pgwire
./zig-out/bin/sydradb pgwire 127.0.0.1 6432

Defaults:

  • address: 127.0.0.1
  • port: 6432

Implementation: cmdPgWire.

ingest

Reads NDJSON from stdin and ingests into the local engine.

cat points.ndjson | ./zig-out/bin/sydradb ingest

Each line must contain series, ts, and value.

Implementation: cmdIngest.

Note: CLI ingest hashes only the series name; see Series IDs for how HTTP derives IDs when tags are present.

query <series_id> <start_ts> <end_ts>

Queries a single series over a time range and prints ts,value rows:

./zig-out/bin/sydradb query 123 1694290000 1694310000

Implementation: cmdQuery.

compact

Runs compaction over stored segments.

./zig-out/bin/sydradb compact

Implementation: cmdCompact.

snapshot <dst_dir>

Writes a snapshot to dst_dir:

./zig-out/bin/sydradb snapshot ./snapshots/2025-01-01

Implementation: cmdSnapshot.

restore <src_dir>

Restores from a snapshot directory:

./zig-out/bin/sydradb restore ./snapshots/2025-01-01

Implementation: cmdRestore.

stats

Prints basic counters (including segment counts). In small_pool allocator mode it also prints allocator stats.

./zig-out/bin/sydradb stats

Implementation: cmdStats.

See also: