Skip to content

sqlmesh init -t dlt / dlt_refresh does not recognise dlt ducklake destination #5914

Description

@michaldrobena

Bug report

When using dlt with a ducklake destination, SQLMesh fails to initialise/refresh from the dlt pipeline metadata.

I see:

Error: Unknown connection type 'ducklake'


Environment

  • SQLMesh: 0.236.0
  • dlt: 1.26.0
  • DuckDB: (installed as dependency of the above)
  • Python: 3.13.x
  • OS: Debian 13 (trixie), x86_64

Minimal reproducible example

1) Create clean environment

mkdir sqlmesh-ducklake-mre && cd sqlmesh-ducklake-mre
python -m venv .venv
source .venv/bin/activate
pip install "sqlmesh==0.236.0" "dlt[duckdb,ducklake]==1.26.0"

2) Create simple dlt pipeline with DuckLake destination

Create a run_pipeline.py file and paste in the following:

import dlt

pipeline = dlt.pipeline(
    pipeline_name="mre_ducklake",
    destination=dlt.destinations.ducklake,
    dataset_name="mre",
)

pipeline.run([{"id": 1, "name": "a"}], table_name="items")
print("done")

Run the pipeline

python run_pipeline.py

3) Run SQLMesh dlt integration command

See the docs here

Running this command:

# sqlmesh init -t <template> --pipeline-name <pipeline-name> --dlt-path <pipelines-directory> dialect
sqlmesh init -t dlt --pipeline-name mre_ducklake --dlt-path ~/.local/share/dlt/pipelines duckdb

Generates this error:

Error: Unknown connection type 'ducklake'.

Notes

This appears to be destination-type mapping logic in the dlt integration path, where dlt.destinations.ducklake is present in dlt pipeline state but not recognised by SQLMesh. I do not experience this issue where dlt.destinations.ducklake is present the dlt pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions