Skip to content

Commit 8ebea93

Browse files
Document Trino advanced properties and update extension sidebar/config docs (#296)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 71825a4 commit 8ebea93

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

src/documentation/setup/config.malloynb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,30 @@ Snowflake also supports TOML configuration at `~/.snowflake/connections.toml`. S
125125
| `user` | string | Username. Default: `{env: "TRINO_USER"}` |
126126
| `password` | password | Password. Default: `{env: "TRINO_PASSWORD"}` |
127127
| `setupSQL` | text | Connection setup SQL ([see below](#setup-sql)) |
128+
| `source` | string | Source name sent to Trino (appears in query tracking) |
129+
| `ssl` | json | TLS/SSL configuration object |
130+
| `session` | json | Session properties as `{"key": "value"}` pairs |
131+
| `extraCredential` | json | Extra credentials as `{"key": "value"}` pairs |
132+
| `extraHeaders` | json | Additional HTTP headers as `{"key": "value"}` pairs |
133+
134+
The `ssl`, `session`, `extraCredential`, and `extraHeaders` properties accept JSON objects that are passed directly to the underlying [trino-client](https://github.com/trinodb/trino-js-client) library. For example, to connect to a Trino server with a self-signed certificate:
135+
136+
```json
137+
{
138+
"connections": {
139+
"my_trino": {
140+
"is": "trino",
141+
"server": "https://trino.example.com",
142+
"catalog": "hive",
143+
"user": "analyst",
144+
"password": {"env": "TRINO_PASSWORD"},
145+
"ssl": {"rejectUnauthorized": false}
146+
}
147+
}
148+
}
149+
```
150+
151+
Because these properties use the `json` type, `{"env": "..."}` inside them is treated as literal data, not as an environment variable reference.
128152

129153
### `presto` — Presto
130154

src/documentation/setup/extension.malloynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ When both exist, config file connections take priority. Settings connections are
5454

5555
### Connections Sidebar
5656

57-
The **Malloy Connections** sidebar shows all configured connections grouped by source:
57+
The **Malloy Connections** sidebar shows the effective connections for the file you are currently editing, grouped by source:
5858

59-
- **Config** — Connections from discovered `malloy-config.json` files. These are read-only in the editor; edit the JSON file directly to make changes.
59+
- **Config** — Connections from the `malloy-config.json` that applies to the active file. These are read-only in the editor; click the file icon on the group header to open the JSON file for editing.
6060
- **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.
6161
- **Defaults** — One entry per supported database type, using built-in defaults. Click to create a new settings connection from the default.
6262

63-
Click any connection to open the connection editor, or use the **+** button to create a new connection.
63+
The sidebar updates automatically as you switch between files, so it always reflects the connections that would be used if you ran a query from the current file. Click any connection to open the connection editor, or use the **+** button to create a new connection.
6464

6565
### Project Configuration: `malloy-config.json`
6666

67-
Place a `malloy-config.json` file in the root of your project (workspace root). The extension detects it automatically and picks up changes whenever you save. In multi-root workspaces, each workspace root can have its own file with independent connection namespaces.
67+
Place a `malloy-config.json` file in your project directory. The extension finds the config that applies to the current file by walking up from the file's directory toward the workspace root. It uses the first `malloy-config.json` it encounters. This means you can place a config file at the workspace root for project-wide connections, or in a subdirectory to override connections for files in that subtree. In multi-root workspaces, each workspace root has its own independent config search.
6868

6969
The extension also reads [persistence manifests](../experiments/persistence.malloynb) from the config's `manifestPath` directory. When the builder (`malloy-cli build`) writes a manifest, VS Code picks it up on the next compile — no restart needed.
7070

0 commit comments

Comments
 (0)