DuckDBDuckDB

Supermetal replicates to DuckDB over the Quack protocol, DuckDB's native binary protocol on HTTP.

Prerequisites

  • A DuckDB instance with the Quack extension serving over HTTP.
  • Network connectivity from Supermetal to the Quack endpoint (default port 9494).

Setup

Start a Quack server

Install the Quack extension and start serving.

INSTALL quack;
LOAD quack;
CALL quack_serve('quack:0.0.0.0:9494', allow_other_hostname => true);

This prints the listen URI, HTTP URL, and a generated authentication token. Save the token for the next step.

Configure the connection

FieldDescription
URLHTTP URL of the Quack endpoint (e.g., http://localhost:9494)
TokenAuthentication token returned by quack_serve
SSL VerifyVerify the server's TLS certificate. Disable if the certificate is not issued by a trusted CA.

Target database and schema

FieldDefaultDescription
Target Database(required)Database to write into. Must be attached on the DuckDB server before syncing. Can be any attached database, including DuckLake catalogs. Verify with SHOW DATABASES.
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.

On DuckDB versions before 1.4, primary key constraints are required for dedup.

Multi table transactions

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

DuckLake

DuckLake databases work as any other attached target database. Set the target database to the name of your attached DuckLake catalog and Supermetal writes to it directly. No additional setup required.

Data Types Mapping

Arrow TypeDuckDB TypeNotes
Int8TINYINT
Int16SMALLINT
Int32INTEGER
Int64BIGINT
UInt8UTINYINT
UInt16USMALLINT
UInt32UINTEGER
UInt64UBIGINT
Float16FLOAT
Float32FLOAT
Float64DOUBLE
Decimal128(p,s)DECIMAL(p,s)Falls back to VARCHAR when precision exceeds 38
Decimal256(p,s)DECIMAL(p,s)Falls back to VARCHAR when precision exceeds 38
Arrow TypeDuckDB TypeNotes
BooleanBOOLEAN
Arrow TypeDuckDB TypeNotes
Date32, Date64DATE
Time32, Time64TIME
Timestamp(s, None)TIMESTAMP_S
Timestamp(ms, None)TIMESTAMP_MS
Timestamp(us, None)TIMESTAMPMicrosecond precision, DuckDB's default
Timestamp(ns, None)TIMESTAMP_NS
Timestamp(ns, "UTC")TIMESTAMP_NS
Timestamp(*, "UTC")TIMESTAMPUTC timestamps except nanosecond
Timestamp(*, tz)TIMESTAMPTZTime zones other than UTC
IntervalINTERVAL
DurationVARCHAR
Arrow TypeDuckDB TypeNotes
Utf8, LargeUtf8VARCHAR
Arrow TypeDuckDB TypeNotes
Binary, LargeBinary, FixedSizeBinaryBLOB
Arrow TypeDuckDB TypeNotes
Utf8 with arrow.json extensionVARIANTDuckDB 1.5+. Falls back to JSON on older versions.
StructSTRUCT(...)Field names and types preserved
MapMAP(K, V)
Arrow TypeDuckDB TypeNotes
List<T>, LargeList<T>, FixedSizeList<T>T[]

Nullability

Nullable source columns are nullable on the target. All columns except primary keys are nullable by default to handle CDC edge cases. Enable preserve_source_nullability to carry over NOT NULL constraints from the source schema.

Changelog

Last updated on

On this page