From 07b85aea3d1b8ded0baed2d93862f74e5719351a Mon Sep 17 00:00:00 2001 From: James Swirhun Date: Mon, 15 Dec 2025 16:08:43 -0700 Subject: [PATCH 1/2] docs: add MotherDuck CLI connection documentation Documents how to connect to MotherDuck using the CLI via the create-duckdb command with --database-path and --mother-duck-token options. Aligns with malloy-cli PR #124. --- src/documentation/setup/cli.malloynb | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/documentation/setup/cli.malloynb b/src/documentation/setup/cli.malloynb index 40da8c23..0ccdc429 100644 --- a/src/documentation/setup/cli.malloynb +++ b/src/documentation/setup/cli.malloynb @@ -28,7 +28,7 @@ malloy-cli --help The CLI stores its own configuration separately from VS Code in `~/.config/malloy/config.json`. -**Note:** The CLI does not support environment variables for connection configuration. Use the CLI commands below to manage connections. +**Note:** The CLI does not support environment variables for connection configuration (except for MotherDuck, which can use `MOTHERDUCK_TOKEN`). Use the CLI commands below to manage connections. ### Connection Commands @@ -58,7 +58,7 @@ malloy-cli connections create-bigquery # For Postgres malloy-cli connections create-postgres -# For DuckDB +# For DuckDB (or MotherDuck) malloy-cli connections create-duckdb ``` @@ -78,6 +78,13 @@ malloy-cli connections create-bigquery --help -m, --maximum-bytes-billed Limit bytes scanned ``` +**DuckDB options:** + +``` + --database-path Path to DuckDB database file or MotherDuck database (e.g., "md:my_database") + --mother-duck-token MotherDuck API token (can also use MOTHERDUCK_TOKEN env var) +``` + ### Default Connections Two connections are created automatically: @@ -96,6 +103,37 @@ gcloud auth login --update-adc malloy-cli connections create-bigquery my-bq ``` +### MotherDuck + +MotherDuck connections use the `create-duckdb` command with special options. To connect to MotherDuck, you'll need an access token: + +1. Log in to MotherDuck and go to **Settings** +2. Create and copy your access token +3. Create the connection using `create-duckdb` with `--database-path` set to `md:` followed by your database name: + +**Using environment variable (recommended):** + +```bash +export MOTHERDUCK_TOKEN="your_token_here" +malloy-cli connections create-duckdb my-md --database-path "md:my_database" +``` + +**Using command-line flag:** + +```bash +malloy-cli connections create-duckdb my-md \ + --database-path "md:my_database" \ + --mother-duck-token "your_token_here" +``` + +If you don't specify a database name, use `md:`: + +```bash +malloy-cli connections create-duckdb my-md \ + --database-path "md:" \ + --mother-duck-token "your_token_here" +``` + --- ## Basic Commands From 97113675fa344ab0422b8e8bde89a6d6e02e2952 Mon Sep 17 00:00:00 2001 From: James Swirhun Date: Mon, 15 Dec 2025 16:19:11 -0700 Subject: [PATCH 2/2] DCO Remediation Commit for James Swirhun I, James Swirhun , hereby add my Signed-off-by to this commit: 07b85aea3d1b8ded0baed2d93862f74e5719351a Signed-off-by: James Swirhun