Skip to content

Results Panel

The kdb results panel is the default target for q runs. It uses this extension's direct driver path and keeps focus in the q editor while results update.

Result tabs

Default kdb-panel runs open a new result tab unless this setting is changed:

"kdb-sqltools.results.kdbPanel.defaultRunMode": "replace"

Replace commands reuse the current or first existing kdb result tab. New commands open an independent result tab.

New result grouping keeps new kdb result tabs beside existing kdb result tabs when one is already present. The first panel uses kdb-sqltools.results.kdbPanel.initialViewColumn.

Large results

The panel virtualizes rows and columns. It transfers only the visible cell window from the extension host to the webview, reducing DOM work for large tables.

The q IPC response is still fully materialized in extension memory before display. Use q-side limits for truly large results:

1000#select from trade where date=.z.D

Very large results show a non-blocking warning. Copy, export, search, and sort may require additional work because they operate beyond the currently visible cells.

Cancel running queries

When a run is still loading, the toolbar shows a short Cancel button next to the spinner. The same run can also be canceled from VS Code's progress notification. Canceling stops the extension from waiting for that result, closes the active q IPC connection, and changes the panel to a canceled state so late results from that run do not replace newer output.

Server-side interruption is best-effort. If the q process or gateway has already started the work, closing the client IPC connection may not stop that work immediately.

Column controls

Feature Behavior
Resize Drag column edges to set widths for the current panel session.
Auto-fit Enabled by default from Settings -> Preferences. It sizes visible columns from headers and currently rendered cells as you scroll.
Reorder Settings -> header mode Drag lets you drag headers to reorder visible columns. A drag cue marks the insertion position.
Select columns Settings -> header mode Select turns header clicks into whole-column selection.
Sort Settings -> header mode Sort cycles ascending, descending, and original order. Sorting uses visible cell text.
Hidden columns Hide columns from the panel settings menu for the current panel session. Reset restores all columns.

Column reorder, sort, search, copy, and export use the current visible column order. Hidden-column choices persist only for later results in the same panel when the full column list matches.

Toolbar

The toolbar is a single compact line:

Output: [format] [Headers] [Row #] [Copy] [Export] [Chart] [Settings] [Cancel] [spinner/status]
Tool Behavior
Chart button Opens the uPlot-powered chart UI for the current visible result. After the chart panel is open, it provides compact chart type, x, optional Group by, and y controls for line, scatter, step, bar, and box charts, plus auto-thinned readable x-axis labels, cursor tooltip, drag zoom, debounced and explicit Refine zoom, reset zoom, splitter resize, legend toggling, persisted selections for matching column signatures, and PNG export after render. Changing controls leaves the old rendered chart visible until Render is pressed.
Settings menu Contains collapsible sections for view controls, search, hidden columns, output defaults, and local data server controls. Preferences opens by default; Data server is collapsed by default. The Data server section starts or stops the opt-in 127.0.0.1 server, copies current-result URLs, and reminds users that very large current.* exports may need a higher local server cell limit.

The local data server and chart both use the extension-side current result. Hidden, reordered, and sorted visible columns are honored where they apply.

Selection

The panel supports:

  • Cell ranges.
  • Whole-row selection.
  • Whole-column selection.
  • Full table selection.
  • Deselect all.

With no selection, copy and export use all cells.

Settings search runs in the extension against visible columns only. It returns capped row-match metadata to the webview, so the panel does not need to transfer every cell to search. The search status indicates capped or partial scans.

Array display formats

kdb-sqltools.results.kdbPanel.arrayDisplayFormat controls array and list cell display:

Value Example
commaSpace 1, 2, 3
space 1 2 3
raw [1 2 3] where q-like bracketed display is available

Text copy/export formats use this display text. JSON and NDJSON keep structured values.

Non-table q result display

True q tables and keyed tables always open as grids. Top-level non-table composite results can be configured independently:

Setting suffix Default Applies to
functionDisplayStrategy qText Functions, lambdas, projections, compositions, and unknown function-like values.
dictionaryDisplayStrategy grid Dictionaries.
listDisplayStrategy grid General, mixed, and object lists.
objectDisplayStrategy grid Plain objects or nested composite values decoded as objects.

Use grid for the existing synthetic table form, or qText for deterministic q-like output in a plain text viewer. Settings JSON also accepts table as an alias for grid, and text as an alias for qText.

Example:

{
  "kdb-sqltools.results.kdbPanel.dictionaryDisplayStrategy": "qText",
  "kdb-sqltools.results.kdbPanel.listDisplayStrategy": "qText"
}

Function source is not reconstructed. If q IPC only supplies a function marker, the panel shows a source-unavailable message instead of inventing a definition. Return string f or .Q.s f from q when exact source/default q text is required.

Local data and charting

See Local data server for tokenized localhost endpoints and Python/pandas usage.

See Charting for the built-in uPlot chart UI, interactions, downsampling, grouping, and current limitations.