dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.

Home Page:https://getdbt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] add the primary key in the model level of the html generated by dbt docs serve

salimmoulouel opened this issue · comments

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

I would like to be able to find in the documentation the primary/foreign key generated by the dbt docs serve

Describe alternatives you've considered

image

Who will this benefit?

No response

Are you interested in contributing this feature?

i have a merge request ready.

Anything else?

No response

@salimmoulouel we can take a peek at your proposed PR(s) to see if this is functionality that we'd like to adopt or not.

Were your changes only in dbt-core (#10035), or were they in dbt-docs also?

If you needed changes to dbt-docs too, wanna share a link and I'll take a look?

Hello @dbeatty10, at the moment, my alterations are solely within dbt-core. The necessity for this functionality stems from BigQuery's inability to accept multiple primary key declarations at the column level. Consequently, I must implement them at the model level. Currently, the dbt documentation pertains to the column level.

I think There are two potential solutions:

  1. Have dbt automatically convert primary key declarations from the column level to the model level for BigQuery.
  2. Incorporate primary key documentation at the model level.

I created the following issue in the dbt-bigquery repo
dbt-labs/dbt-bigquery#1186

Agreed that those would be the two potential solutions to consider.

Considering each potential solution

Potential solution 1

I don't think we'd be likely to adopt the 1st one of converting primary key declarations from the column level to the model level for dbt-bigquery.

If we did, we'd probably do it for all adapters and not just dbt-bigquery.

Potential solution 2

So the 2nd potential solution of incorporate primary key documentation at the model level seems like the more fruitful path to consider:

Next steps in the discussion

To focus the conversation on the most fruitful path, I'm going to close both #10034 and dbt-labs/dbt-bigquery#1186 in favor of dbt-labs/dbt-docs#507. We can always re-open them after further discussion if needed.

I'll see you over in dbt-labs/dbt-docs#507 to discuss further!