Skip to content

Feat/entity relation diagram#14

Merged
CyprienKelma merged 18 commits intomainfrom
feat/entity-relation-diagram
Nov 29, 2025
Merged

Feat/entity relation diagram#14
CyprienKelma merged 18 commits intomainfrom
feat/entity-relation-diagram

Conversation

@CyprienKelma
Copy link
Member

This PR simply add a way to generate a EDR (UML) schema directly from dbt models.
It's useful here to generate a proper Mermaid UML schema of Fact and Dim tables.

To use it simply do :
cd dbt
python -m dbt_erd --model-path models/mart --config erd_config.yml

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Entity Relationship Diagram (ERD) generation capabilities to the dbt project using the dbt-model-erd package. The implementation enables automatic generation of Mermaid UML diagrams from dbt model definitions and relationships, specifically for the star schema fact and dimension tables.

  • Adds dbt-model-erd>=0.1.1 dependency for ERD generation
  • Updates model naming from single to double underscores (dim__users, fct__viewings)
  • Modernizes GitHub Actions workflow to use uv for dependency management

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pyproject.toml Adds dbt-model-erd dependency to project requirements
uv.lock Updates lock file with dbt-model-erd package and related dependencies including newer platform-specific greenlet wheels
dbt/erd_config.yml Configuration file for ERD generation with naming patterns, visualization settings, and Mermaid output options
dbt/models/mart/core/dim__users/dim__users.yml Updates model name to double underscore convention and removes age range validation test
dbt/models/mart/core/dim__content/dim__content.yml Updates model name to double underscore convention
dbt/models/mart/core/dim__devices/dim__devices.yml Updates model name and adds incorrectly-directed relationship test
dbt/models/mart/core/dim__date/dim__date.yml Updates model name, removes week_number range validation, and updates description
dbt/models/mart/core/fct__viewings/fct__viewings.yml Updates model name and foreign key descriptions to match new naming convention
dbt/assets/img/mart/core/fct__viewings/fct__viewings_model.mmd Generated Mermaid diagram source file for fact table ERD
dbt/assets/img/mart/core/fct__viewings/fct__viewings_model.html Generated interactive HTML visualization with download capabilities
.github/workflows/publish-dbt-doc.yml Modernizes workflow to use uv for dependency management and adds compile step before docs generation
debug_manifest.py Adds debug script for inspecting dbt manifest structure
test.excalidraw.png Test artifact that should not be committed
logs/dbt.log Debug logs that should not be committed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CyprienKelma CyprienKelma self-assigned this Nov 29, 2025
@CyprienKelma CyprienKelma added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 29, 2025
@CyprienKelma CyprienKelma moved this from Todo to In Progress in Summer Media Nov 29, 2025
@CyprienKelma CyprienKelma linked an issue Nov 29, 2025 that may be closed by this pull request
@CyprienKelma CyprienKelma requested a review from Bafbi November 29, 2025 11:44
@CyprienKelma CyprienKelma merged commit a7c12f4 into main Nov 29, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Summer Media Nov 29, 2025
@CyprienKelma CyprienKelma deleted the feat/entity-relation-diagram branch November 30, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Adds an Entity Relationship Diagram (ERD) automatic builder

2 participants