pq.q
Examples
.pq.versionselect handle, alias from .pq.conns[]Entity Summary
| Entities | Short Description |
|---|---|
| .pq.cancolor[] | Whether stdout should carry ANSI colour: PEACHQ_COLORS=0/1 overrides everything, then NO_COLOR (off), FORCE_COLOR (on), else a tty whose TERM is not dumb. |
| .pq.conns[] | Every open connection, one row each; -38! keeps kdb's letters, these are the same facts in words. |
| .pq.dr[verb] | Print a verb's domain and range grid in the layout the KX reference pages use, probed with a sample of every type (an atom each side of a dyad, a three-item vector for a monad): a lower-case letter is an atom result, upper-case a list, "." an error. |
| .pq.hl | The console's syntax colours, role to colour, read by the highlighter at each redraw. |
| .pq.hopen_duckdb[alias;arg] | Attach a DuckDB database as `:pq:duckdb:alias, the same call as hopen (`:pq:duckdb:alias;arg). |
| .pq.hopen_kafka[alias;arg] | Open a Kafka client as the alias `:pq:kafka:alias; arg is librdkafka's config as a dict of its keys, metadata.broker.list at least and group.id to subscribe. |
| .pq.hopen_q[alias;arg] | Open (or re-point) `:pq:q:alias on another q process, the same call as hopen (`:pq:q:alias;arg); answers that symbol. |
| .pq.hopen_qfork[alias;arg] | Fork this process as the worker `:pq:qfork:alias, the same call as hopen (`:pq:qfork:alias;arg). |
| .pq.hopen_qspawn[alias;arg] | Launch a fresh peachq as the worker `:pq:qspawn:alias, the same call as hopen (`:pq:qspawn:alias;arg). |
| .pq.info[x] | What peachq itself holds behind a `:pq: handle, a dict of tables: a table coordinate answers `schema (col dtype logical iskey t, as bound on first touch); an alias answers `tables (table origin bound: what is bound, `q or `duckdb by the sidecar, when) and `stats (binds hits rebinds dropped). |
| .pq.load[files] | Load standard-library files not already loaded; \l pq/ |
| .pq.render_modern[x] | The modern display of x as a string: exactly what the console prints when it is not in \classic mode, whatever the session's mode, clipped by \c like .Q.s. |
| .pq.summary[t] | One line of facts about a table, one per column in column order: numeric columns as min-max, booleans as the share true, everything else as a distinct count (`all distinct` when every row differs; a temporal column that repeats shows its range), with a null count where there are nulls. |
| .pq.termsize[] | The live terminal size, with the 25/80 fallback and [10,2000] clamp that \c 0N uses. |
| .pq.tlsinfo[] | How each HTTPS client in this process checks a server's certificate, one row per transport: `peachq for .Q.hg, read0, select from an https URL and hopen of tcps:// or wss://, and `duckdb once DuckDB's httpfs extension is loaded. |
| .pq.version | The peachq version string. |
Entity Details
.pq.cancolor[]
Whether stdout should carry ANSI colour: PEACHQ_COLORS=0/1 overrides everything, then NO_COLOR (off), FORCE_COLOR (on), else a tty whose TERM is not dumb.
| Return: | boolean |
|---|
Examples
.pq.cancolor[].pq.conns[]
Every open connection, one row each; -38! keeps kdb's letters, these are the same facts in words.
| Columns: |
|
|---|
Examples
.pq.conns[]exec handle from .pq.conns[] where spec=`:pq:qfork:w1.pq.dr[verb]
Print a verb's domain and range grid in the layout the KX reference pages use, probed with a sample of every type (an atom each side of a dyad, a three-item vector for a monad): a lower-case letter is an atom result, upper-case a list, "." an error. After KX's tools.q (qdocs/docs/docs/tools.q, CC BY 4.0).
| Parameters: |
|
|---|
Examples
.pq.dr `neg.pq.dr "+".pq.hl
The console's syntax colours, role to colour, read by the highlighter at each redraw. Roles: kw keywords, str strings, esc string escapes, cmt comments, sym symbols, num numbers, tmp temporals and typed nulls, op verbs and adverbs, sys system names, cmd \ commands, match the bracket or quote pair at the cursor. A colour is an int 0-255 (a 256-colour foreground) or a string of digits and ; used as the SGR parameters. A role left out, or given anything else, keeps its default; with colour off (.pq.cancolor) nothing is coloured. Amend in place (.pq.hl[`kw]:141) or set it in QINIT; loading this file again resets it. The defaults mirror the C table in src/qlang/repl/q_highlight.c - change both together.
.pq.hopen_duckdb[alias;arg]
Attach a DuckDB database as `:pq:duckdb:alias, the same call as hopen (`:pq:duckdb:alias;arg).
| Parameters: |
|
|---|
.pq.hopen_kafka[alias;arg]
Open a Kafka client as the alias `:pq:kafka:alias; arg is librdkafka's config as a dict of its keys, metadata.broker.list at least and group.id to subscribe. The alias consumes and publishes.
Examples
.pq.hopen_kafka[`c1;`metadata.broker.list`group.id!`localhost:9092`myapp].pq.hopen_q[alias;arg]
Open (or re-point) `:pq:q:alias on another q process, the same call as hopen (`:pq:q:alias;arg); answers that symbol.
| Parameters: |
|
|---|
.pq.hopen_qfork[alias;arg]
Fork this process as the worker `:pq:qfork:alias, the same call as hopen (`:pq:qfork:alias;arg).
| Parameters: |
|
|---|
.pq.hopen_qspawn[alias;arg]
Launch a fresh peachq as the worker `:pq:qspawn:alias, the same call as hopen (`:pq:qspawn:alias;arg).
| Parameters: |
|
|---|
.pq.info[x]
What peachq itself holds behind a `:pq: handle, a dict of tables: a table coordinate answers `schema (col dtype logical iskey t, as bound on first touch); an alias answers `tables (table origin bound: what is bound, `q or `duckdb by the sidecar, when) and `stats (binds hits rebinds dropped). Connection facts are .pq.conns[]; the catalog is SQL.
| Parameters: |
|
|---|
Examples
.pq.info hopen (`:pq:duckdb:demo;":memory:").pq.load[files]
Load standard-library files not already loaded; \l pq/
| Return: | (symbol list) the files this call loaded |
|---|---|
| Parameters: |
|
Examples
.pq.load`regexp.pq.render_modern[x]
The modern display of x as a string: exactly what the console prints when it is not in \classic mode, whatever the session's mode, clipped by \c like .Q.s. A table or keyed table is the pipe table; anything else is the text .Q.s returns, which is always the classic display.
| Return: | (string) the display, ending in a newline |
|---|---|
| Parameters: |
|
Examples
.pq.render_modern ([]a:1 2;b:`x`y).pq.summary[t]
One line of facts about a table, one per column in column order: numeric columns as min-max, booleans as the share true, everything else as a distinct count (`all distinct` when every row differs; a temporal column that repeats shows its range), with a null count where there are nulls. The same facts the console digest prints under a clipped table, so the two never disagree.
| Return: | string, `-1`-ready |
|---|---|
| Parameters: |
|
Examples
.pq.summary ([]a:1 2 3;b:`x`y`x).pq.termsize[]
The live terminal size, with the 25/80 fallback and [10,2000] clamp that \c 0N uses.
| Return: | (rows;cols) |
|---|
Examples
.pq.termsize[].pq.tlsinfo[]
How each HTTPS client in this process checks a server's certificate, one row per transport: `peachq for .Q.hg, read0, select from an https URL and hopen of tcps:// or wss://, and `duckdb once DuckDB's httpfs extension is loaded. With no SSL_CA_CERT_FILE or SSL_CA_CERT_PATH set, peachq trusts the operating system's roots: Windows' root store, or OpenSSL's default bundle elsewhere. SSL_VERIFY_SERVER=NO turns checking off.
| Columns: |
|
|---|
Examples
.pq.tlsinfo[]first exec last_error from .pq.tlsinfo[] where transport=`peachq