MainTargetsMotherduck

MotherDuck Setup

Prerequisites

  • A MotherDuck account with an access token.
  • An external object store configured as the Supermetal buffer. Local file paths are not supported over the Postgres endpoint.
  • A persistent secret in MotherDuck for the object store (see step 2 below).

Setup

Connect to MotherDuck

MotherDuck exposes a Postgres wire protocol endpoint. Use it to connect from Supermetal without running DuckDB locally.

FieldValue
Hostpg.<region>-aws.motherduck.com (e.g., pg.us-east-1-aws.motherduck.com)
Port5432
Userpostgres
PasswordYour MotherDuck access token
DatabaseDatabase name, or md: for the default database

Access token

See Authenticating to MotherDuck to create an access token.

Create object store secret

Create a secret so MotherDuck can read Parquet files from Supermetal's buffer (S3, Azure Blob Storage).

Open the MotherDuck SQL console and run one of the following.

CREATE SECRET IN MOTHERDUCK (
    TYPE S3,
    KEY_ID '...',
    SECRET '...',
    REGION 'us-east-1'
);
CREATE SECRET IN MOTHERDUCK (
    TYPE AZURE,
    CONNECTION_STRING 'AccountName=myaccount;AccountKey=...'
);

Target database and schema

FieldDefaultDescription
Target Database(required)Database to write into. Created automatically if it does not exist.
Target SchemaOptional. When set, all source tables land in this schema regardless of their source schema. Otherwise, each table keeps its source schema. Created if it does not exist.

Primary Keys

Opt in. Supermetal deduplicates using MERGE without primary key constraints on the table. Enabling primary keys adds the constraint, enforcing uniqueness at the database level.

Multi table transactions

Opt in. When enabled, each CDC batch wraps in a transaction, preserving source transaction boundaries across tables.

DuckLake

Supermetal can write to DuckLake databases on MotherDuck. Create a DuckLake database (fully managed or BYOB) and set it as the target database.

CREATE DATABASE my_ducklake (TYPE DUCKLAKE);

Last updated on

On this page