DuckDB & MotherDuck connection

IP RESTRICTION

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.

Add Production Connection

To add the DuckDB or MotherDuck Production connection, go to account settings > connections, select Production Environment and enter the required fields.

Configuration for a DuckDB Connection

In the Production connection setup screen, you will need to fill in the form with the details of the connection you want to use to run dbt™️ models against a DuckDB 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.

Field Details

Below are list of fields and example to create a connection.

FieldDescriptionExampleLevel

Profile Name

The profile name set in your dbt_project.yaml . See more here.

dbt-duckdb

🏢 Workspace level

Target

The target name used to identify the connection. See more here.

prod

🏢 Workspace level

Profile Configuration

  • Here is where you can define the path to the DuckDB database where the dbt™️ will run.

  • Additionally you will be able to configure any supported DuckDB extensions by listing them in the extensions

  • You can also set any additional DuckDB configuration options via the settings field, including options that are supported in any loaded extensions.

      extensions:
      - httpfs
      - parquet
      path: ./dbt.duckdb
      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

Schema

The default schema used to build dbt™️ objects at runtime.

dbt_prod

👥 User level

Threads

The number of threads used in this connection. See more here.

8

👥 User level

Configuration for a MotherDuck Connection

In the Production connection setup screen, you will need to fill in the form with the details of the connection you want to 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.

Field Details

Below are list of fields and example to create a connection.

FieldDescriptionExampleLevel

Profile Name

The profile name set in your dbt_project.yaml . See more here.

dbt-motherduck

🏢 Workspace level

Target

The target name used to identify the connection. See more here.

prod

🏢 Workspace level

Profile Configuration

  • Here is where you can define the path to the MotherDuck database where the dbt™️ will run.

  • Additionally you will be able to configure any supported DuckDB extensions by listing them in the extensions

  • You can also set any additional DuckDB configuration options via the settings field, including options that are supported in any 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

Schema

The default schema used to build dbt™️ objects at runtime.

dbt_prod

👥 User level

Threads

The number of threads used in this connection. See more here.

8

👥 User level

Authenticating to MotherDuck

When using MotherDuck we will need to persist your MotherDuck service token for authentication.

Fetching the service token

To fetch your service token:

  • Go to the MotherDuck UI

  • In top right click on user profile and then Settings

  • Copy the service token to your clipboard by clicking on "Copy token"

Storing the service token as a workspace environment variable

You can save the service token as motherduck_token in your workspace environment variables in Paradime by navigating to your workspace settings.

Last updated