Connections Overview
This page provides an overview of how to create, manage, and use connections in the kdb Visual Studio Code Extension.
Connections define how the extension communicates with q processes and kdb Insights environments. They act as execution targets for running q, Python, or SQL code, and allow you to switch between different environments without leaving the editor.
The extension supports multiple concurrent connections, enabling you to work with local processes, remote services, and kdb Insights deployments at the same time.
Connection types
The extension supports different connection types depending on your workflow:
-
My q connections. Connect to an existing local or remote q process. These are unmanaged sessions where the extension does not start or control the process.
-
kdb Insights connections. Connect to a kdb Insights Enterprise deployment, providing access to APIs, scratchpads, and platform services.
-
Quick connections. Create temporary, ad hoc connections using a connection string (for example,
host:port). These are not persisted and are useful for rapid testing or one-off access.
Managing connections
You can create, edit, and manage connections from the Connections view in the VS Code sidebar. Once created, connections are available as execution targets for:
- Running code from source files, notebooks, and workbooks
- Querying data and inspecting results
Connections can be updated or removed at any time, and you can switch between them as needed during development.
Selecting a connection
You can select a connection per editor (source files, notebooks, or workbooks) using the Choose Connection option at the top of the editor.
This allows you to:
- Use different connections across multiple open editors
- Isolate work across environments (for example, dev, test, and prod)
- Control exactly where code is executed
Important
If no connection is explicitly selected, the extension defaults to executing code in the REPL. For more information on the REPL, refer to the REPL guide.
Organizing connections
To manage multiple connections effectively, the extension provides features such as:
- Labels – Group and categorize connections (for example, dev, test, prod)
- Import and export – Share connection configurations across machines or teams
- Multiple active connections – Work across environments within the same session
These features help maintain clarity when working with multiple systems and reduce the risk of running code against the wrong environment.
Further reading
The following pages provide detailed guidance on working with connections: