datnguye / dbterd

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

[FEAT] Make name of output file customizable through CLI argument #97

Closed Thootje closed 5 months ago

Thootje commented 5 months ago

Is your feature request related to a problem? Please describe.

For our usecase, we want to output 2 different ERD diagrams for 2 different sets of data models. These 2 usecases are however located in the same repository. Therefore, we want to setup a flow in which we execute 2 dbterd commands to generate 2 different DBML outputs. However, the name of the DBML output file is always output.dbml. (see: https://github.com/datnguye/dbterd/blob/a03af25c9efe9fe4f32208e4b1a2acd93a51df7a/dbterd/adapters/targets/dbml/dbml_test_relationship.py#L18C14-L18C20). This means we have to create two different directories in which to save the output files to. Also, the name 'output' is kind of generic. Finally, you can't create two seperate output files in the same directory because of this.

Describe the solution you'd like Make the output file name dynamic and add an extra CLI argument to set a custom output file name.

Describe alternatives you've considered

datnguye commented 5 months ago

Thanks @Thootje for filing the request! 👍

Yes I agree! It makes sense to customize the output file name. You're more than welcome to create a pull request for it too ❤️ .

NOTE: Currently please expect for a low speed of releasing new feats/fixes as I need to dedicate much of time with family as of now, but will try to come up with it as soon as possible.

Thanks 🙌

Thootje commented 5 months ago

I will take a look next week if I think I can do it myself. 👍

datnguye commented 5 months ago

Hey @Thootje not sure if you secure this change yet, sorry if yes. I have sometime today so just quickly make the change.

It should be published with v1.13 🏃

datnguye commented 5 months ago

It's now available in 1.13.2 with the latest docs here 🎉

Thootje commented 5 months ago

Thanks a lot! I didn't have time last week unfortunately :(