Skip to content

Commit 95b1f32

Browse files
docs: note shareable + setupSQL ATTACH interaction
1 parent 220e9ef commit 95b1f32

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/documentation/setup/config.malloynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Malloy exposes two parameters that let you choose how a connection participates
139139

140140
`readOnly` and `shareable` compose: `shareable: true` plus `readOnly: true` means the file is attached read-only and released between operations, so other read-only readers and intermittent writers in other processes can all coexist. Neither flag does anything for `:memory:` databases (no file lock to release) or for MotherDuck / remote URLs (no local file at all).
141141

142+
**`shareable` and `setupSQL` interaction.** Shareable mode reserves the alias `malloy_db` and runs `ATTACH '<databasePath>' AS malloy_db; USE malloy_db.main` internally. Don't use `ATTACH` against `databasePath` or the `malloy_db` alias from `setupSQL` — those collide. Other `ATTACH` statements in `setupSQL` (different file, different alias) are fine, but they run once at connection setup and are not released on idle, so any file you attach that way keeps its lock for the lifetime of the connection. If you need a secondary file to be release-on-idle too, give it its own malloy connection with `shareable: true` instead of attaching it via `setupSQL`.
143+
142144
### `bigquery` — Google BigQuery
143145

144146
| Parameter | Type | Description |

0 commit comments

Comments
 (0)