feat: enable label override for the display name of tables and refs#130
Conversation
|
Thanks @dsmdavid for the PR, looks great! 🙌 Some observations on this PR:
TY |
|
Thanks, I think I've fixed the format, what do you think of using |
I think let’s do relationship_label to be consistent for now. I guess you worry about the meta attributes’ name conflicts. We can consider to add these meta attributes nested in a parent attribute named dbterd later. |
|
Hey @dsmdavid just FYI and sorry for any inconveniences here since I just merged the PR to migrate the new Python package manager In order to continue iteration on this PR, could you help to merge the latest code? Feel free to let me know if you'd need any supports here. |
|
Thanks, Dat. I merged the changes and will rename the 'label' to 'relationship_label' shortly |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #130 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 31 31
Lines 1238 1244 +6
=========================================
+ Hits 1238 1244 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I've modified the labels for the relationship to |
Thanks @dsmdavid Looks great to me! Just to double check 1 thing before updating the docs about the Table Label: What would be the use case where the Label would be different from Model Name? Keen to hear so that we can update docs site accordingly Created #132 for docs work Cheers |
|
This feat should be available in dbterd 1.20.0 🎉 |
|
Thanks, @datnguye! models:
- name: <domain_name>_derived__rpt_<subdomain>_<table_name>_hist
schema: <domain_name>_derivedwith the options provided by models:
- name: axw_derived__rpt_ccd_customers_hist
schema: axw_derived
meta:
label: customers
|
|
FYI: the docs page is now available here: https://dbterd.datnguyen.de/latest/nav/metadata/label_override.html Let me know if you'd have any time to review and feedback. Cheers |
A potential approach to the discussion #129 to allow custom overrides. This approach uses the default values (fully qualified names for db objects, name of the columns for relationships) unless a
labelis specified in themetaoption.Currently only implemented for test_relationships, but not for the semantic model.
e.g. taking as input:
by including the custom label value
to obtain a expanded properties file like:
Changes the output from:
erDiagram "MODEL.DVD_UTILS.SAMPLE1" { date date_column } "MODEL.DVD_UTILS.SAMPLE2" { date date_column date date_column_b } "MODEL.DVD_UTILS.SAMPLE2" }|--|| "MODEL.DVD_UTILS.SAMPLE1": date_columnto:
erDiagram "MODEL.DVD_UTILS.SAMPLE1"["ALTERNATIVE_SAMPLE_1"] { date date_column } "MODEL.DVD_UTILS.SAMPLE2" { date date_column date date_column_b } "MODEL.DVD_UTILS.SAMPLE2" }|--|| "MODEL.DVD_UTILS.SAMPLE1": preferred_relationship_name