Flags

Every flag sqx understands, with its default. Flags can appear before or after the SQL text.

Query flags

FlagDefaultDescription
-f <name=path>—Load a file or URL as a table. Repeatable. Without name=, the table is named after the file.
-t <name>stdinTable name for piped stdin
-i <format>autostdin format: auto, csv, tsv, jsonl, json, lines
-o <format>autoOutput: auto (table on a terminal, csv when piped), csv, tsv, table, md, json, jsonl, raw
-db <path>:memory:SQLite database for persistent tables
-save <table>—Save the result into <table> in -db, replacing it if it exists
-no-headerfalseCSV/TSV input has no header row; columns become c1, c2, …
-no-output-headerfalseOmit the header row in csv/tsv output
-versionfalsePrint the version and exit

Cache flags

These apply to queries, prefetch and import.

FlagDefaultDescription
-cache-db <path>User cache folderCache file. Use one per project or in CI.
-cache-ttl <dur>168hMax age of cached HTTP and DNS entries; 0s always refetches
-offlinefalseNever use the network; a cache miss returns status 0 / NULL
-forcefalseIgnore the cache and fetch each URL again
-timeout <dur>15sHTTP request timeout
-ua <string>sqx/<version>User-Agent header
-max-body-bytes <n>10485760Maximum response body size kept per URL (10 MiB)

Durations use Go syntax: 30s, 15m, 1h, 24h, 168h.

Subcommand flags

CommandFlags
prefetch-c <workers> (default 10), -o, cache flags
import-db (default sqx.db), -t (default data), -i, -no-header, -replace, cache flags
cache-all, -older-than <dur>, -cache-db, -o
tables, schema-db (default sqx.db), -o