Skip to content

draw lineage graph of your dbt project as mermaid flowchart

License

Notifications You must be signed in to change notification settings

kitta65/dbt-mermaid

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

dbt-mermaid

This action draws lineage graph of your dbt project as mermaid flowchart.

flowchart LR
  classDef greenNormal color:white,stroke:fuchsia,fill:green,stroke-width:0px;
  classDef greenBold color:white,stroke:fuchsia,fill:green,stroke-width:4px;
  classDef greenDash color:white,stroke:fuchsia,fill:green,stroke-width:4px,stroke-dasharray: 5 5;
  classDef blueNormal color:white,stroke:fuchsia,fill:blue,stroke-width:0px;
  classDef blueBold color:white,stroke:fuchsia,fill:blue,stroke-width:4px;
  classDef blueDash color:white,stroke:fuchsia,fill:blue,stroke-width:4px,stroke-dasharray: 5 5;
  classDef orangeNormal color:white,stroke:fuchsia,fill:orange,stroke-width:0px;
  classDef orangeBold color:white,stroke:fuchsia,fill:orange,stroke-width:4px;
  classDef orangeDash color:white,stroke:fuchsia,fill:orange,stroke-width:4px,stroke-dasharray: 5 5;
  source.dbt_mermaid.source.events("source.events"):::greenNormal;
  source.dbt_mermaid.source.users("source.users"):::greenNormal;
  source.dbt_mermaid.source.orders("source.orders"):::greenNormal;
  source.dbt_mermaid.source.products("source.products"):::greenNormal;
  model.dbt_mermaid.users("users"):::blueNormal;
  model.dbt_mermaid.sessions_v2("sessions_v2"):::blueBold;
  model.dbt_mermaid.stg_events("stg_events"):::blueNormal;
  model.dbt_mermaid.stg_orders("stg_orders"):::blueNormal;
  model.dbt_mermaid.stg_users("stg_users"):::blueNormal;
  model.dbt_mermaid.stg_products("stg_products"):::blueNormal;
  snapshot.dbt_mermaid.products_snapshot("products_snapshot"):::blueNormal;
  analysis.dbt_mermaid.top10_users("top10_users"):::blueNormal;
  test.dbt_mermaid.assert_user_id_is_uuid("assert_user_id_is_uuid"):::blueNormal;
  seed.dbt_mermaid.internal_users("internal_users"):::blueNormal;
  exposure.dbt_mermaid.user_analysis("user_analysis"):::orangeNormal;
  exposure.dbt_mermaid.session_analysis("session_analysis"):::orangeNormal;
  model.dbt_mermaid.sessions("sessions"):::blueDash;
  model.dbt_mermaid.users --> analysis.dbt_mermaid.top10_users;
  model.dbt_mermaid.users --> exposure.dbt_mermaid.user_analysis;
  model.dbt_mermaid.sessions_v2 ==> exposure.dbt_mermaid.session_analysis;
  model.dbt_mermaid.stg_events ==> model.dbt_mermaid.sessions_v2;
  model.dbt_mermaid.stg_orders --> model.dbt_mermaid.users;
  model.dbt_mermaid.stg_users ==> model.dbt_mermaid.sessions_v2;
  model.dbt_mermaid.stg_users --> model.dbt_mermaid.users;
  seed.dbt_mermaid.internal_users --> model.dbt_mermaid.stg_users;
  source.dbt_mermaid.source.events --> model.dbt_mermaid.stg_events;
  source.dbt_mermaid.source.users --> model.dbt_mermaid.stg_users;
  source.dbt_mermaid.source.users --> test.dbt_mermaid.assert_user_id_is_uuid;
  source.dbt_mermaid.source.orders --> model.dbt_mermaid.stg_orders;
  source.dbt_mermaid.source.products --> model.dbt_mermaid.stg_products;
  source.dbt_mermaid.source.products --> snapshot.dbt_mermaid.products_snapshot;
  model.dbt_mermaid.sessions -.-> exposure.dbt_mermaid.session_analysis;
  model.dbt_mermaid.stg_events -.-> model.dbt_mermaid.sessions;
Loading

Usage

See action.yml for details.

Examples

  • Save entire lineage graph as artifacts on push (yml).

  • Visualize modified models and its parents/children on pull requests (yml).

Feedback

If you find any bugs, please feel free to create an issue.