DB
Getting Started

The nyxsql CLI

Connect to a node with nyxsql, run one-shot and streaming queries, and split the terminal to watch multiple queries.

nyxsql is the interactive terminal client — a multi-pane TUI for running queries and following streaming results live.

Install & connect

cd drivers/cli
npm install
npm start -- --host 127.0.0.1 --port 7777
# or, after `npm link`:
nyxsql --host 127.0.0.1 --port 7777

Use the port your server is listening on (the Docker image defaults to 7777; local dev builds in the docs use 7510).

Running queries

  • A one-shot query (SELECT …) runs and returns a result grid.
  • A streaming query — SELECT STREAM … — opens a live subscription: the snapshot loads, then new rows update the grid in place until you stop it.
SELECT STREAM symbol, payload, amount
FROM events
WHERE tenant_id = 42 AND active = true;

Server timing

Results report dual timing, proton-style:

3 rows · server 28µs · 2ms round-trip
  • server — measured on the server (prepare + execute).
  • round-trip — client-side wall time including the network hop.

Keybindings

KeyAction
EnterRun the focused pane's query
Ctrl+N / Ctrl+XNew / close pane
Tab / Shift+TabFocus next / previous pane
Up / DownMove across input lines, then query history
Ctrl+SToggle split layout (side-by-side / stacked)
Ctrl+OToggle pane between table and changelog mode
Ctrl+LClear the focused pane
Ctrl+CStop the running query; press again within 2s to quit

The changelog mode (Ctrl+O) shows the raw stream of insert/update/remove operations behind a streaming result, rather than the reconciled grid.

On this page