> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MotherDuck

## MotherDuck

<Warning>
  **IP RESTRICTIONS**

  Make sure to allow traffic from one of the Paradime IPs in your firewall depending on the data location selected.

  👉 See also: [Paradime IP addresses](https://docs.paradime.io/app-help/developers/ip-restrictions).
</Warning>

### Add the DinoAI agent environment connection

1. Click **Settings** in the top menu bar of the Paradime interface to access **Account Settings**
2. In the left sidebar, click **Connections**
3. Click **Add New** next to the **DinoAI Background Agent Environment** section
4. Select **MotherDuck** and fill out the corresponding fields.

### Configuration for a MotherDuck connection

In the DinoAI agent environment setup screen, fill in the form with the connection details DinoAI will use to run dbt™ models against a MotherDuck database.

In this example we are connecting to `s3` to read/write `parquet` files using an AWS access key and secret. These secrets can be stored in the [user environment variable settings](https://docs.paradime.io/app-help/documentation/settings/environment-variables/code-ide-env-variables).

<Frame>
  <img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2Fws8MXwm4KrayK1MHYotT%2FScreenshot%202024-07-29%20at%2022.17.10.png?alt=media&token=8746d85e-c2d4-4520-a90d-f8350e66b0ec" alt="" />
</Frame>

#### Field details

| Field                   | Description                                                                                                                                                                                                                                                                                                                                                                  | Example                                                                                                                                                                                                                                       | Level              |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| Profile Name            | The profile name set in your `dbt_project.yaml`. See more [here](https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles).                                                                                                                                                                                                                               | **`dbt-motherduck`**                                                                                                                                                                                                                          | 🏢 Workspace level |
| Target                  | The target name used to identify the DinoAI agent environment connection. See more [here](https://docs.getdbt.com/reference/dbt-jinja-functions/target).                                                                                                                                                                                                                     | **`dinoai`**                                                                                                                                                                                                                                  | 🏢 Workspace level |
| Profile Configuration   | • Define the path to the MotherDuck database where dbt™ will run.• Configure any supported [DuckDB extensions](https://duckdb.org/docs/extensions/overview) by listing them in the `extensions` field.• Set additional [DuckDB configuration options](https://duckdb.org/docs/sql/configuration) via the `settings` field, including options supported by loaded extensions. | `extensions: - httpfs - parquet path: md:jaffle_shop_prod settings: s3_access_key_id: '{{ env_var("S3_ACCESS_KEY_ID") }}' s3_region: '{{ env_var("S3_REGION", "us-west-1") }}' s3_secret_access_key: '{{ env_var("S3_SECRET_ACCESS_KEY") }}'` | 👥 User level      |
| MotherDuck access token | The MotherDuck service token used by the DinoAI agent for authentication. See more [here](https://motherduck.com/docs/key-tasks/authenticating-to-motherduck/#authentication-using-an-access-token). Stored as `motherduck_token` in your environment variables.                                                                                                             | `eyJhb.....0LXgyJFE695yrZx40UhAOF9JIFX8jNLf1WOAPO42Q`                                                                                                                                                                                         |                    |
| Schema                  | The default schema used to build dbt™ objects during DinoAI background agent sessions.                                                                                                                                                                                                                                                                                       | **`dbt_dinoai`**                                                                                                                                                                                                                              | 👥 User level      |
| Threads                 | The number of threads used in this connection. See more [here](https://docs.getdbt.com/docs/running-a-dbt-project/using-threads).                                                                                                                                                                                                                                            | **`8`**                                                                                                                                                                                                                                       | 👥 User level      |

#### Authenticating to MotherDuck

When using MotherDuck, you need to create and persist a MotherDuck service token for the DinoAI agent to authenticate.

To create an access token:

1. Go to the [MotherDuck UI](https://app.motherduck.com/)
2. In the top left, click on your organisation name and then **Settings**
3. Click **+ Create token**
4. Specify a name for the token (e.g. "Paradime DinoAI")
5. Choose whether you want the token to expire and click **Create token**
6. Copy the access token to your clipboard

<Frame>
  <img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F33K2HjHnz5xCxaygGWmi%2Fimage.png?alt=media&token=4d75bb71-7e4c-4605-a9a5-f6b26ef60886" alt="" />
</Frame>

<Info>
  For additional supporting docs, see [MotherDuck key features](https://motherduck.com/docs/category/key-tasks), [MotherDuck SQL reference](https://motherduck.com/docs/category/motherduck-sql-reference), and [DuckDB SQL reference](https://motherduck.com/docs/category/duckdb-sql-reference).
</Info>


## Related topics

- [MotherDuck](/products/settings/connections/development-environment/motherduck.md)
- [Harlequin](/integrations/harlequin.md)
- [DuckDB](/products/settings/connections/development-environment/duckdb.md)
- [Scheduler environment](/products/settings/connections/scheduler-environment/index.md)
