Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BQ now supports FK & PK; take into account for diagrams 🙏 #448

Open
MaximusMcCann opened this issue Mar 1, 2023 · 8 comments
Open

BQ now supports FK & PK; take into account for diagrams 🙏 #448

MaximusMcCann opened this issue Mar 1, 2023 · 8 comments
Assignees
Labels

Comments

@MaximusMcCann
Copy link

MaximusMcCann commented Mar 1, 2023

You can now define Foreign and Primary keys on table columns in BigQuery. Would love to see them interpreted and added to the lovely image output to see connections between tables.

Google docs regarding adding FK and PK constraints.
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_table_add_constraint_statement

Queries to pull the information off the schema about FK & PK.

https://cloud.google.com/bigquery/docs/information-schema-constraint-column-usage

SELECT *
FROM <PROJECT_ID>.<DATASET>.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE;

https://cloud.google.com/bigquery/docs/information-schema-key-column-usage

SELECT *
FROM <PROJECT_ID>.<DATASET>.INFORMATION_SCHEMA.KEY_COLUMN_USAGE;

https://cloud.google.com/bigquery/docs/information-schema-table-constraints

SELECT *
FROM <PROJECT_ID>.<DATASET>.INFORMATION_SCHEMA.TABLE_CONSTRAINTS;

General spot for BQ schema information: https://cloud.google.com/bigquery/docs/information-schema-intro

@MaximusMcCann MaximusMcCann added the enhancement New feature or request label Mar 1, 2023
@MaximusMcCann MaximusMcCann changed the title BQ now supports FK & PK; take into account for diagrams BQ now supports FK & PK; take into account for diagrams 🙏 Mar 1, 2023
@k1LoW
Copy link
Owner

k1LoW commented Mar 1, 2023

@MaximusMcCann Thank you for your report!

@k1LoW k1LoW self-assigned this Mar 1, 2023
@MaximusMcCann
Copy link
Author

Of course! :)

@markthepixel
Copy link

This would be awesome!

@unstoppable-allensun
Copy link

Would love to see this feature!

@fruwe
Copy link

fruwe commented Mar 13, 2023

This would be really helpful!!

@tunguyennnnn
Copy link

This would be very helpful!

@sudoryan
Copy link

Thanks for the issue! I would like to have this as well

@helfi92
Copy link

helfi92 commented Mar 15, 2023

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants