Destination contract
The final ClickHouse table must exist before delivery begins. You can create it with the explicit setup action in the destination editor when available, or run reviewed DDL in ClickHouse yourself. The delivery runner does not create final tables. The table should:- use a
MergeTreeengine family member such asMergeTreeorReplacingMergeTree; - contain every column selected by the published SQL model;
- use compatible types; and
- define a primary or unique key for deterministic Upsert behavior.
Required destination access
Create a dedicated writer. If table creation is managed separately, the runtime user needs only data access to existing tables.CREATE, ALTER, and DROP only to a separate setup user or when
your operating policy explicitly allows the app’s setup action to reconcile
tables.
Connection fields
The HTTP port is the transport used by the loader to deliver rows into
ClickHouse. The native port is the transport used by the dlt ClickHouse
destination’s native protocol. Both ports are required by the destination.
Create the connection
- Open Connections.
- Click + New Connection.
- Set the role to Destination.
- Choose ClickHouse.
- Fill the connection fields.
- Click Test Connection.
- Save after the test succeeds.
Prepare a destination table
This example accepts event rows from a relational source:event_id, event_time, user_id, amount,
and status. Columns with database defaults, such as synced_at, can be
omitted when the table permits it.
Configure delivery
- Open Destinations and click Add destination.
- Choose the ClickHouse connection, target database, and save.
- Open Transformations, select that destination, and create the SQL model.
- Save, validate, preview, and publish the revision.
- Return to the destination editor and, under Published output targets,
enter
database.table, for exampleanalytics.events. - Choose the stable primary or unique key as the Upsert key.
- Create/verify the table when needed and save the destination.
Upsert behavior
With a primary or unique key, a first run inserts rows and later runs update the matching rows. This is the recommended production configuration. Without a key, delivery cannot identify an existing row deterministically. Add a stable primary or unique key before enabling repeated runs. For tables that useReplacingMergeTree, physical duplicate versions may
exist until merges occur. Resolve duplicates deterministically on the
destination side when needed.
Verify delivery
Troubleshooting
For a list of pairings validated by the platform, see the
ClickHouse source and destination connector reference.