Both connectors are available on Meltano Hub. Here's how to set it up:

1. Initialize a Meltano project (if needed)

meltano init my-project
cd my-project

2. Add the tap and target

meltano add extractor tap-postgres
meltano add loader target-ducklake --variant=definite

3. Configure the connectors

You can configure via CLI or directly in meltano.yml:

# Postgres source
meltano config tap-postgres set host localhost
meltano config tap-postgres set port 5432
meltano config tap-postgres set user your_user
meltano config tap-postgres set password your_password
meltano config tap-postgres set database your_database
meltano config tap-postgres set default_replication_method FULL_TABLE

# DuckLake target
meltano config target-ducklake set ducklake_connection_string "ducklake:md:my_ducklake?motherduck_token=xxx"
meltano config target-ducklake set default_target_schema raw

Or in meltano.yml:

plugins:
  extractors:
    - name: tap-postgres
      variant: meltanolabs
      config:
        host: localhost
        port: 5432
        user: your_user
        password: your_password
        database: your_database
        default_replication_method: FULL_TABLE
  loaders:
    - name: target-ducklake
      variant: definite
      config:
        ducklake_connection_string: "ducklake:md:my_ducklake?motherduck_token=xxx"
        default_target_schema: raw

4. Run the sync

meltano run tap-postgres target-ducklake

Or with the older elt command:

meltano elt tap-postgres target-ducklake --job_id=postgres-to-ducklake

Useful options

The target-ducklake is the Definite variant—it supports DuckLake's iceberg-style table format with options like auto_cast_timestamps, batch_size_rows, and partition_fields for more advanced setups.