Skip to main content

MotherDuck

This destination writes data to MotherDuck, a cloud-based analytics platform built on DuckDB. You can also use this destination to write to a local DuckDB file.

This destination implements Destinations V2, which provides improved final table structures. Learn more about Destinations V2 in Typing and Deduping.

Prerequisites

Setup guide

Step 1: Create a MotherDuck access token

  1. Log in to the MotherDuck UI.
  2. Click your organization name in the top left, then click Settings.
  3. Click + Create token.
  4. Name the token and select Read/Write as the token type.
  5. Copy the token and enter it in the MotherDuck Access Token field in Airbyte.
caution

Do not include your access token in the md: connection string. This may cause the token to appear in execution logs. Use the MotherDuck Access Token field instead.

Step 2: Configure the destination database

In the Destination DB field, enter the MotherDuck database URI using the md: prefix. For example:

  • md: connects to the default MotherDuck database (my_db).
  • md:my_database connects to a database named my_database.

Step 3: Configure the schema (optional)

In the Schema Name field, enter the database schema where Airbyte writes data. If you leave this field blank, data is written to the main schema.

Supported sync modes

Sync modeSupported?
Full Refresh - OverwriteYes
Full Refresh - AppendYes
Full Refresh - Overwrite + DedupedYes
Incremental Sync - AppendYes
Incremental Sync - Append + DedupedYes

Output schema

Each table contains the following Airbyte metadata columns in addition to the columns from your source data:

  • _airbyte_raw_id: A UUID assigned to each record during processing.
  • _airbyte_extracted_at: A timestamp representing when the record was extracted from the source.
  • _airbyte_meta: A JSON object containing metadata about the record.

Data generations are not currently supported.

Namespace support

This destination supports namespaces. The namespace maps to a DuckDB schema in your MotherDuck database.

Known limitations

  • Column names are normalized to lowercase. If your source data contains columns that differ only by case, such as userId and userid, one of the columns is dropped.

Working with local DuckDB files

This connector can also write to local DuckDB files. To use a local file, enter a file path instead of a md: URI in the Destination DB field, for example /local/destination.duckdb. For file-based destinations, data is written to /tmp/airbyte_local by default. To change this location, modify the LOCAL_ROOT environment variable for Airbyte.

If you only need local DuckDB files and don't use MotherDuck, consider the DuckDB destination instead.

Reference

Config fields reference

Field
Type
Property name
string
motherduck_api_key
string
destination_path
string
schema

Changelog

Expand to review
VersionDatePull RequestSubject
0.2.22026-03-1770438Fix for camelCase columns being NULL
0.2.12026-01-2970999Fix for empty STRUCTs
0.2.02026-01-0671063Upgrade DuckDB to v1.4.2 and duckdb-engine to v0.17.0
0.1.262025-10-2168338Update dependencies
0.1.252025-10-1467952Update dependencies
0.1.242025-10-0766822Update dependencies
0.1.232025-08-0864161feat: allow null values in primary key fields. Primary keys are no longer declared as table constraints.
0.1.222025-07-2263714fix(destination-motherduck): handle special characters in stream name when creating tables
0.1.212025-07-2263709fix: resolve error "Can't find the home directory at '/nonexistent'" #63710
0.1.202025-07-0662133fix: when primary_key is not defined in the catalog, use source_defined_primary_key if available
n/a2025-06-2748673Update dependencies
0.1.192025-05-2560905Allow unicode characters in database/table names
0.1.182025-03-0154737Update airbyte-cdk to ^6.0.0 in destination-motherduck
0.1.172024-12-2650425Fix bug overwrite write method not saving all batches
0.1.162024-12-0648562Improved handling of config parameters during SQL engine creation.
0.1.152024-11-0748405Updated docs and hovertext for schema, api key, and database name.
0.1.142024-10-3048006Fix bug in _flush_buffer, explicitly register dataframe before inserting
0.1.132024-10-3047969Preserve Platform-generated id in state messages.
0.1.122024-10-3047987Disable PyPi publish.
0.1.112024-10-3047979Rename package.
0.1.102024-10-2947958Add state counts and other fixes.
0.1.92024-10-2947950Fix bug: add double quotes to column names that are reserved keywords.
0.1.82024-10-2947952Fix: Add max batch size for loads.
0.1.72024-10-2947706Fix bug: incorrect column names were used to create new stream table when using multiple streams.
0.1.62024-10-2947821Update dependencies
0.1.52024-10-2847694Resolve write failures, move processor classes into the connector.
0.1.42024-10-2847688Use new destination table name format, explicitly insert PyArrow table columns by name and add debug info for column mismatches.
0.1.32024-10-2347315Fix bug causing MotherDuck API key to not be correctly passed to the engine.
0.1.22024-10-2347315Use saas_only mode during connection check to reduce ram usage.
0.1.12024-10-2347312Fix: generate new unique destination ID
0.1.02024-10-2346904New MotherDuck destination