ProductDocumentationExamplesBlogRoadmapGitHubGet Started
Available

SQL & Explain

krishiv sql and krishiv explain flags, --mode, --local, --remote, --timeout, --api-key.

Both commands share the same flags. explain additionally prints the logical and physical plan.

Usage

krishiv sql --query "SELECT 42 AS answer"
krishiv sql --local --mode single-node --query "SELECT 1"
krishiv sql --remote -c http://127.0.0.1:50051 --query "SELECT 1"
krishiv sql --api-key dev-key --query "SELECT * FROM people"
krishiv explain --query "SELECT * FROM orders WHERE amount > 100"

Flags

FlagEffect
-q, --query <SQL> (required)The statement to run. Multi-statement is supported with ; separator; only the last statement's result is printed.
--mode <embedded|single-node|distributed>Override the runtime mode for this query. Default: embedded.
--localShortcut for --mode single-node. Also uses Session::execute_local instead of Session::sql, which never routes to a remote coordinator even if one is configured.
--remoteUse Session::execute_remote. Requires a configured coordinator (KRISHIV_COORDINATOR or -c). Fails with a clear error if no coordinator is reachable.
--timeout <SECS>Per-query timeout in seconds. Default: 30.
--api-key <KEY>Authenticate the query with a static API key. Server-side keys are configured via KRISHIV_API_KEYS=key1=user,key2=svc,....
--parquet <table=path>Register a Parquet file as a SQL table before running the query. Repeatable.

Multi-statement

--query can contain multiple statements separated by ;. Only the last statement's result is printed. To capture intermediate results, run them as separate invocations.

Output

StatementOutput
SELECTASCII table with up to --limit rows.
EXPLAIN (any statement)Plan text after the result.
CREATE / DROP"OK" with timing.
INSERT / MERGE / UPDATE / DELETEAffected row count and timing.
START PIPELINESink output (memory, console) and the running query ID.

Environment variables

VariableEffect
KRISHIV_COORDINATORDefault coordinator URL for --remote.
KRISHIV_MODEDefault mode for the CLI (overridden by --mode).
KRISHIV_REMOTE_EXEC1 / true / yes / on forces execute_remote.
KRISHIV_API_KEYSServer-side: comma-separated key=user pairs for API key auth.

See also