datnguye / dbterd

Generate the ERD as a code from dbt artifacts
https://dbterd.datnguyen.de/
MIT License
198 stars 28 forks source link

[FEAT] Ensure that the order of tables and relationships in the output diagram does not change each time #80

Closed syou6162 closed 7 months ago

syou6162 commented 7 months ago

Is your feature request related to a problem? Please describe. We would like to run dbterd on GitHub Actions and add markdown files with mermaid as artifacts to the GitHub repository. However, each time we run dbterd, there is a subtle difference in the output markdown file. The rendered diagram is the same, but the order of the output tables and relationships is different, so essentially the same content is being judged as differing.

Describe the solution you'd like Ensure ordering of tables and relationships. Perhaps apply a sorted function to the tables and relations in the return value of the parse function.

Describe alternatives you've considered N/A

Additional context This is probably due to the fact that the contents of manifest.json output by dbt are not guaranteed to be in order.