Skip to content

Commit cd05e82

Browse files
Update connection docs for new sidebar and editor UI (#282)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 99c7898 commit cd05e82

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

src/documentation/setup/config.malloynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The `is` field identifies the connection type. All other fields are type-specifi
2828

2929
### Where the config file lives
3030

31-
- **VS Code Extension** — place `malloy-config.json` in your workspace root. The extension detects it automatically and picks up changes on save. In multi-root workspaces, each root can have its own file.
31+
- **VS Code Extension** — place `malloy-config.json` in your workspace root. The extension detects it automatically and picks up changes on save. In multi-root workspaces, each root can have its own file. You can also set a global fallback directory via the `malloy.globalConfigDirectory` setting (e.g. `~/.config/malloy`) — this is used when no workspace config file exists.
3232
- **Malloy CLI** — `~/.config/malloy/malloy-config.json`. See the [CLI setup](cli.malloynb) for details.
3333

3434
---
@@ -145,9 +145,9 @@ SET search_path TO analytics; CREATE TEMP TABLE foo AS SELECT 1;
145145

146146
---
147147

148-
## Sensitive Values
148+
## Environment Variables
149149

150-
Fields with type `password` or `secret` contain sensitive values like credentials and API tokens. Instead of putting these directly in your config file, you can use an environment variable reference:
150+
Any property value can be replaced with an environment variable reference. This is especially useful for sensitive values like passwords and API tokens, so they don't need to appear directly in your config file:
151151

152152
```json
153153
{

src/documentation/setup/database_support.malloynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Malloy connects to a variety of databases. This page provides an overview of sup
1212
| [BigQuery](../language/dialect/bigquery.malloynb) | `bigquery` | OAuth or service account authentication |
1313
| [Snowflake](../language/dialect/snowflake.malloynb) | `snowflake` | Password or RSA key authentication |
1414
| [PostgreSQL](../language/dialect/postgres.malloynb) | `postgres` | Standard credentials |
15-
| [MySQL](../language/dialect/mysql.malloynb) | `mysql` | Environment variables only (VS Code) |
15+
| [MySQL](../language/dialect/mysql.malloynb) | `mysql` | Standard credentials |
1616
| [Trino / Presto](../language/dialect/presto-trino.malloynb) | `trino` / `presto` | Server URL + optional auth |
1717

1818
---

src/documentation/setup/extension.malloynb

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,19 @@ The Malloy Extension also works in VS Code Web environments like github.dev. Pre
4848
There are two ways to configure database connections:
4949

5050
1. **`malloy-config.json`** (recommended) — a project-level config file checked into source control
51-
2. **VS Code Settings** — user-level configuration via the command palette
51+
2. **VS Code Settings** — user-level configuration via the Connections sidebar
5252

53-
**Note:** If a `malloy-config.json` exists in your workspace root, VS Code settings for connections are ignored entirely — all connections come from the config file.
53+
When both exist, config file connections take priority. Settings connections are used as a fallback for any connection names not defined in the config file.
54+
55+
### Connections Sidebar
56+
57+
The **Malloy Connections** sidebar shows all configured connections grouped by source:
58+
59+
- **Config** — Connections from discovered `malloy-config.json` files. These are read-only in the editor; edit the JSON file directly to make changes.
60+
- **Settings** — User-defined connections from VS Code settings. Editable through the connection editor. If a settings connection has the same name as a config connection, it appears as "(shadowed)" since the config version takes priority.
61+
- **Defaults** — One entry per supported database type, using built-in defaults. Click to create a new settings connection from the default.
62+
63+
Click any connection to open the connection editor, or use the **+** button to create a new connection.
5464

5565
### Project Configuration: `malloy-config.json`
5666

@@ -60,18 +70,31 @@ See **[Configuration](config.malloynb)** for the full config file format, connec
6070

6171
### VS Code Settings
6272

63-
You can also configure connections through the VS Code command palette:
73+
You can also configure connections through the Connections sidebar or the command palette:
6474

6575
1. Open Command Palette: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux)
6676
2. Type: **Malloy: Edit Connections**
6777
3. Click **Add Connection** and select your database type
6878
4. Fill in the connection details
6979

70-
VS Code stores these in your user settings:
80+
Sensitive values (passwords, tokens) are stored securely in your system keychain.
81+
82+
### Connection Editor
83+
84+
The connection editor lets you view and manage individual connections:
85+
86+
- **Test** — Verify the connection works with the current settings
87+
- **Duplicate** — Create a copy of an existing connection
88+
- **Delete** — Remove a settings connection
89+
90+
Config file connections open in a read-only view. You can still test them, but edit the JSON file directly to change settings.
91+
92+
### Connection Settings
7193

72-
**Mac:** `~/Library/Application Support/Code/User/settings.json`
73-
**Windows:** `%APPDATA%\Code\User\settings.json`
74-
**Linux:** `~/.config/Code/User/settings.json`
94+
| Setting | Description | Default |
95+
|---------|-------------|---------|
96+
| `malloy.globalConfigDirectory` | Directory containing a global `malloy-config.json`, used as a fallback when no workspace config file exists (e.g. `~/.config/malloy`) | `""` |
97+
| `malloy.projectConnectionsOnly` | Only use workspace config file connections — hides global config, settings, and defaults | `false` |
7598

7699
---
77100

0 commit comments

Comments
 (0)