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. |
| .pq.dr[verb] | Print a verb's domain and range grid in the layout the KX reference pages use, probed by casting a sample of every type: 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.load[files] | Load standard-library files not already loaded; \l pq/ |
| .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.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. The single-letter columns p f z n m are the -38! names so kdb code ports.
| Columns: |
|
|---|
Examples
.pq.conns[].pq.dr[verb]
Print a verb's domain and range grid in the layout the KX reference pages use, probed by casting a sample of every type: 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.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.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[]