Flags
Every flag sqx understands, with its default. Flags can appear before or after the SQL text.
Query flags
| Flag | Default | Description |
|---|---|---|
-f <name=path> | — | Load a file or URL as a table. Repeatable. Without name=, the table is named after the file. |
-t <name> | stdin | Table name for piped stdin |
-i <format> | auto | stdin format: auto, csv, tsv, jsonl, json, lines |
-o <format> | auto | Output: 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-header | false | CSV/TSV input has no header row; columns become c1, c2, … |
-no-output-header | false | Omit the header row in csv/tsv output |
-version | false | Print the version and exit |
Cache flags
These apply to queries, prefetch and import.
| Flag | Default | Description |
|---|---|---|
-cache-db <path> | User cache folder | Cache file. Use one per project or in CI. |
-cache-ttl <dur> | 168h | Max age of cached HTTP and DNS entries; 0s always refetches |
-offline | false | Never use the network; a cache miss returns status 0 / NULL |
-force | false | Ignore the cache and fetch each URL again |
-timeout <dur> | 15s | HTTP request timeout |
-ua <string> | sqx/<version> | User-Agent header |
-max-body-bytes <n> | 10485760 | Maximum response body size kept per URL (10 MiB) |
Durations use Go syntax: 30s, 15m, 1h, 24h, 168h.
Subcommand flags
| Command | Flags |
|---|---|
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 |