-
Notifications
You must be signed in to change notification settings - Fork 392
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add a mechanism to export the dlt.Schema as a Mermaid diagram string
Motivation
Mermaid is a diagram format supported in many places:
- GitHub markdown (great for
README, PR comments) - marimo (dlt Dashboard, interactive notebook)
- IDE chat windows (e.g., Copilot, Cursor, Continue)
The key usecase is visualizing the dlt.Schema directly inside the AI chat window. This is not possible with the existing DBML and DOT exports.
Implementation
The implementation should match the .to_dot() (graphviz) and .to_dbml() PRs.
- Create a module
dlt/helpers/mermaid.py - Build the diagram by manipulating strings without additional Python dependencies
- Write modular functions and tests for generating columns, tables, etc.
- Add
dlt.Schema.to_mermaid()method - Add to the CLI
dlt schema --format mermaid FILEanddlt pipeline NAME schema --format mermaid - Update CLI docs
- Add example export to the docs
Key consideration: Try to support converting the schema dlt -> mermaid AND mermaid -> dlt when possible. This makes testing easier. But it's likely impossible. For example, the DBML export doesn't support all possible column attributes
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
In Progress