> ## 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

> Connect MotherDuck to Paradime to run dbt™ against your MotherDuck cloud DuckDB database from the Code IDE, Bolt, and Agent environments.

export const Arcade = ({src, title}) => <div style={{
  position: 'relative',
  paddingBottom: 'calc(56.2225% + 41px)',
  height: 0,
  width: '100%'
}}>
    <iframe src={src} title={title} frameBorder="0" loading="lazy" allow="clipboard-write" allowFullScreen style={{
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  colorScheme: 'light'
}} />
  </div>;

[MotherDuck](https://motherduck.com/) is a cloud data warehouse built on DuckDB. Connect it to Paradime to run dbt™ from the Code IDE, deploy production jobs with Bolt, and let the DinoAI background agent work against your MotherDuck database.

<Warning>
  **IP restrictions**

  Allow traffic from one of the Paradime IPs in your firewall, depending on the data location selected.

  See also: [Paradime IP addresses](/developers/ip-restrictions).
</Warning>

<Note>
  **Available in:** Code IDE, Bolt, and Agent environments.
</Note>

## Add a connection

1. Click **Settings** in the top menu bar of the Paradime interface to access **Workspace Settings**.
2. In the left sidebar, click **Environments**.
3. Click **Add New** next to the section for the environment you are configuring:
   * **Code IDE** for the Code IDE connection
   * **Bolt** for the Bolt connection
   * **Agent** for the Agent connection
4. Select **MotherDuck** and fill out the corresponding fields.

## Configuration

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

In this example you connect to `s3` to read and write `parquet` files using an AWS access key and secret. These secrets can be stored in the [user environment variable settings](/products/settings/environment-variables/code-ide-env-variables).

## 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 connection. See more [here](https://docs.getdbt.com/reference/dbt-jinja-functions/target).                                                                                                                                                                                                                                              | `dev`                                                 | 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 any loaded extensions. | See the example below.                                | User level      |
| MotherDuck access token | The MotherDuck service token for authentication. See more [here](https://motherduck.com/docs/key-tasks/authenticating-to-motherduck/#authentication-using-an-access-token). This is stored with the name `motherduck_token` in your [user environment variables](/products/settings/environment-variables/code-ide-env-variables).                                           | `eyJhb.....0LXgyJFE695yrZx40UhAOF9JIFX8jNLf1WOAPO42Q` | User level      |
| Schema                  | The default schema used to build dbt™ objects at runtime.                                                                                                                                                                                                                                                                                                                    | `dbt_john`                                            | 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      |

Example Profile Configuration:

```yaml theme={"system"}
extensions:
  - httpfs
  - parquet
path: md:jaffle_shop_dev
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") }}'
```

For the Bolt connection, set the target to `prod` and the schema to `dbt_prod`. The MotherDuck access token is stored in your [Bolt Environment Variables](/products/settings/environment-variables/bolt-schedule-env-variables). For the Agent connection, set the target to `dinoai` and the schema to `dbt_dinoai`.

## Authenticating to MotherDuck

When using MotherDuck, you need to create and persist a MotherDuck service token for authentication.

To create an access token:

1. Go to the [MotherDuck UI](https://app.motherduck.com/).
2. In the top left, click on your organization name and then **Settings**.
3. Click **+ Create token**.
4. Specify a name for the token that you will recognize (like "Paradime").
5. Choose whether you want the token to expire and then click **Create token**.
6. Copy the access token to your clipboard by clicking on the copy icon.

## Check you are able to connect to MotherDuck

To test your connection to MotherDuck:

1. Launch the DuckDB CLI and connect to MotherDuck using the Paradime terminal by running the following command:

```bash theme={"system"}
duckdb "md:"
```

2. Test your MotherDuck connection using the following command. It runs in the cloud to display a list of your MotherDuck databases.

```sql theme={"system"}
show all databases;
```

<Arcade src="https://demo.arcade.software/oVWeTMPMz2Zpp1JPpFPR?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="MotherDuck" />

<Info>
  For additional supporting docs, check [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>

## Explore data in your MotherDuck database from Paradime

Paradime integrates with Harlequin out of the box, with no installation required. Check our integration guide on how you can query data directly from the Paradime terminal.

<Card title="Harlequin" href="/integrations/harlequin" horizontal icon="arrow-right" />

## Related

<CardGroup cols={2}>
  <Card title="Optional connection attributes" href="/guides/data-warehouse-essentials/optional-connection-attributes" icon="gear" horizontal>
    Set additional `profiles.yml` attributes for this connection.
  </Card>
</CardGroup>


## Related topics

- [Harlequin](/integrations/harlequin.md)
- [Bolt environment](/products/settings/connections/scheduler-environment/index.md)
- [Agent environment](/products/settings/connections/dinoai-background-agent-environment/index.md)
- [Code IDE environment](/products/settings/connections/development-environment/index.md)
- [DuckDB](/integrations/duckdb.md)
