Skip to main content

MotherDuck

Overview

The MotherDuck destination writes data to MotherDuck, a cloud-based analytics service built on DuckDB. You can also use this destination to write to a local DuckDB file on the host running Airbyte.

This destination implements Destinations V2, which provides improved final table structures. It works with both MotherDuck and local DuckDB files. Learn more about Destinations V2 in the Typing and Deduping documentation.

info

Data generations are not currently supported.

Prerequisites

To use this destination, you need:

Supported sync modes

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

Configuration

MotherDuck API key

Your MotherDuck access token. Required for connecting to MotherDuck. You can create a token in the MotherDuck UI under Settings.

Destination database

The path to a .duckdb file or a MotherDuck database URI using the md: prefix. Defaults to md:, which connects to the default MotherDuck database (my_db).

Examples: md:, md:my_db, /local/destination.duckdb

caution

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

Schema name

The database schema to write data into. Defaults to main if not specified.

Output schema

Each destination table contains the following columns in addition to columns from the source data:

ColumnDescription
_airbyte_raw_idA UUID assigned by Airbyte to each processed record.
_airbyte_extracted_atA timestamp representing when the record was extracted from the source.
_airbyte_metaA JSON object containing metadata about the record.

Column name normalization

This destination normalizes column names from the source data before writing them to the destination table. The normalization rules are:

  • ASCII letters are converted to lowercase.
  • Whitespace is replaced with underscores.
  • Unicode letters and numbers are preserved.
  • An underscore prefix is added if the name starts with a digit.
  • Other special characters are replaced with underscores.

For example, a source column named firstName becomes firstname in the destination, and User Name becomes user_name.

If two source columns produce the same name after normalization (for example, userid and userId both normalize to userid), the record is skipped and a warning is logged. Ensure that source column names are unique after normalization.

tip

If you previously observed NULL values in columns with mixed-case names, upgrade to version 0.2.2 or later and run a full refresh on affected streams.

Working with local DuckDB files

This connector is primarily designed to work with MotherDuck. If you only need to work with local DuckDB files, consider using the DuckDB destination.

For local file-based databases, data is written to /tmp/airbyte_local by default. To change this location, modify the LOCAL_ROOT environment variable for Airbyte.

Namespace support

This destination supports namespaces. The namespace maps to a DuckDB schema.

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.12025-12-1970999Fix for empty STRUCTs
0.2.02025-12-0170221Upgrade 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