Skip to content

View Results

This page explains how query results are displayed in the kdb Visual Studio Code Extension.

Every query you run through the extension — from source files, Workbooks, Notebooks, Data Sources, or the REPL — runs remotely on a connected q process or, for kdb Insights Enterprise, on your user-specific scratchpad or the database tier you select. The extension returns the results to VS Code and displays them in one of two locations: the Output console or the KDB RESULTS view.

Terminal

The Terminal panel contains an output console for each connected connection and for each REPL session. Use it when you run code that produces text output, logs, or error messages.

Each console appears as a separate terminal with a database icon, named KX followed by the connection name. For example, the console for a connection named test is named KX test. REPL terminals are named KX REPL, followed by the folder that the REPL is rooted at, such as KX REPL (qplay). The consoles do not persist between VS Code sessions.

Output console

Each connected connection has its own output console in the Terminal panel. Query results, and the kdb Insights Enterprise scratchpad log, go to the console of the connection that produced them.

The output console gives you a text-based representation of query execution for a single connection, and displays results as the extension receives them. Each entry contains:

  • The code or query that ran
  • A timestamp
  • Any returned text or diagnostic output

When you send results to the KDB RESULTS view instead, the console prints the line Query results are shown in kdb Results View ↗ in place of the results for that query. Select kdb Results View in that line to open the view.

Terminal panel listing the KX test console and a KX REPL terminal, with the console ending in the kdb Results View link

The console keeps as many lines of output as the VS Code terminal.integrated.scrollback setting allows. If you scroll up through earlier results, the console stays where you leave it when new output arrives.

You can hide the full source expression that ran, which reduces clutter when you run frequent or long queries. In Settings, select Kdb: Hide Source Expressions. This setting is enabled by default.

Hide Source Expressions

Output destination

For .q, .quke, .py, .sql, and .kdb.json files, you can choose where results appear:

  1. In the editor title bar, select the Output Destination icon. The icon shows the current destination: a terminal icon for the output console, or a table icon for the KDB RESULTS view.

    Output Destination icon at the right of the editor title bar

  2. Select Terminal to send results to the output console, or kdb Results View to send them to the KDB RESULTS view.

    Output Destination submenu showing the Terminal and kdb Results View options

KDB RESULTS view

The KDB RESULTS view displays the tabular data returned from q, SQL, qSQL, or API queries. The extension formats the results as an interactive table, which makes it easier to:

  • Inspect columns
  • Sort or filter data
  • Validate results before you continue your analysis

kdb results view

Next steps