Library API

Files

FileDescription
csv.qRead delimited text (CSV, TSV) as a table, from a file, a URL or text in memory.
duckdb.qQuery and write DuckDB databases from q: a database is a handle, its tables are q tables.
ffi.qCall C from q: .ffi.bind turns a symbol in any shared library into a q function, .ffi.callFunction is the one-shot form.
j.qRead JSON as a table: .j.read loads a document or JSON Lines from a file, a URL or a string, .j.info shows the schema it would use.
massive.qMarket data from the Massive REST API (massive.com) as q tables: bars, daily aggregates, snapshots, trades, quotes, tickers, splits, dividends, IPOs and news.
parquet.qRead and write parquet files through DuckDB: .parquet.read answers a table, .parquet.write writes one, and the schema, metadata, file_metadata, kv_metadata and bloom_probe verbs answer DuckDB's own inspection tables.
pq.qThe session itself: version, open connections, terminal size and colour support.
qpc.qAnother q process as a data source: h:hopen `:pq:qpc:alias:host:port connects and answers the alias symbol `:pq:qpc:alias; h "1+1" is a sync call, h (`async;"x::1") an async send, `:pq:qpc:alias:table/ is that process's table for get, set, upsert and qsql (the query is pushed to the peer), hclose h closes it.
regexp.qRegular expressions in RE2 syntax: match, extract, capture groups, replace, split and escape.
str.qPython's string helpers with Python's spellings and semantics: strip lstrip rstrip, startswith endswith, removeprefix removesuffix, isalpha isdigit isalnum isspace isupper islower, printf and format.
termbox.qDraw on the terminal as a grid of cells: .termbox.init[] takes the screen, .termbox.show rows paints a list of strings from the top-left corner, .termbox.present[] flushes the changes, .termbox.peek_event 100 waits up to 100 ms for a key or mouse event, .termbox.shutdown[] hands the terminal back.