-
Notifications
You must be signed in to change notification settings - Fork 153
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
[Feature] dbt manage multiple fields as primary key #1186
Labels
Comments
I don't think we'd be likely to convert primary key declarations from the column level to the model level for dbt-bigquery. If we did, we'd probably do it within dbt-core so it applied to all adapters and not just dbt-bigquery. So for now, I'm going to close in this favor of discussing the possibility of making an update to I'll see you over in dbt-labs/dbt-docs#507 to discuss further! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this your first time submitting a feature request?
Describe the feature
BigQuery's Unique Approach to Primary Keys
In BigQuery, primary keys aren't typically defined directly within the table schema as in traditional databases. Instead, a separate constraint is utilized to establish a composite primary key after the table creation process.
Since dbt usually adds "PRIMARY KEY" after each column name for primary keys, this method isn't compatible with BigQuery. To address this, we need to append the following clause at the end of the table declaration:
PRIMARY KEY (field1, field2, ...)
I have an idea for a potential solution, but before implementing it, I need assurance of timely code review. I haven't received any feedback on my last contribution, which can be found here: #1122.
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
yes, write the adapted code
Anything else?
No response
The text was updated successfully, but these errors were encountered: