---
sidebar_position: 5
title: DataGrip
description: Connect JetBrains DataGrip to MotherDuck using the built-in DuckDB integration.
---

JetBrains [DataGrip](https://www.jetbrains.com/datagrip/) is a cross-platform IDE for working with SQL and noSQL databases.
It includes a DuckDB integration, which makes connecting to MotherDuck easy.

## Connecting to MotherDuck in DataGrip

Create a new data source and choose the **DuckDB** driver. DataGrip opens the **Data Sources and Drivers** window where you configure the connection.

### Token Authentication

To retrieve a MotherDuck token, follow the steps in [Authenticating to MotherDuck](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/authenticating-to-motherduck.md).

1. In **Data Sources and Drivers > General**, set **Authentication** to **No auth**.  
2. Populate the **URL** field with the MotherDuck connection string, replacing `my_db` with your database name or omitting it to connect to the default catalog:

```sh
jdbc:duckdb:md:[my_db]
```

![config](../img/datagrip_config.png)

3. Open the **Advanced** tab and add a new parameter named `motherduck_token`, setting its value to the token you generated earlier.

![config](../img/datagrip_token.png)


Click "OK" to begin querying MotherDuck!

:::note
The default schema filtering configuration of DataGrip may hide some of the schemas that exist in your MotherDuck account. Reconfigure to display all schemas following [DataGrip documentation](https://www.jetbrains.com/help/datagrip/schemas.html).
:::

## Update the DuckDB Driver Version

DataGrip bundles a DuckDB JDBC driver, but you can replace it with another version if needed.

1. Visit the [DuckDB JDBC maven repository](https://mvnrepository.com/artifact/org.duckdb/duckdb_jdbc).
2. Select the DuckDB release you want to use and download the `.jar` file listed under **Files**.
3. In the **Data Sources and Drivers** window, switch to the **Drivers** pane and select **DuckDB**.
4. On the **General** tab, find **Driver files**, click the **+** icon, and choose the `.jar` file you downloaded.
5. You need to remove the existing DuckDB driver from the **Drivers** pane for the new driver to take effect (needs to be first in the list).
6. [optional] To restore the default driver, click on the **+** icon and select **DuckDB** among the available drivers.

DataGrip now uses the updated DuckDB driver for MotherDuck connections.
