fix: Error if both PKs and PK components are set#2113
Merged
kodiakhq[bot] merged 1 commit intomainfrom Apr 2, 2025
Merged
Conversation
Member
|
Would this be a |
Member
Author
It's a new validation so yes I think. Could be a |
Member
|
I think |
przste-go
approved these changes
Apr 2, 2025
kodiakhq bot
pushed a commit
that referenced
this pull request
Apr 2, 2025
🤖 I have created a release *beep* *boop* --- ## [4.76.0](v4.75.0...v4.76.0) (2025-04-02) ### Features * Pass installation ID from env to usage report ([#2106](#2106)) ([0bea6e7](0bea6e7)) ### Bug Fixes * **deps:** Update golang.org/x/exp digest to 054e65f ([#2110](#2110)) ([f9875f8](f9875f8)) * **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.26.9 ([#2112](#2112)) ([abd2117](abd2117)) * Error if both PKs and PK components are set ([#2113](#2113)) ([4f0b312](4f0b312)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I spent too much time debugging a bug I had when I (meaning Cursor AI) auto completed
PrimaryKeyComponent: trueinstead ofPrimaryKey: truefor me. Which means I had both PKs and PK components on the same table, causing_cq_idto only be calculated from the PK component, losing data whenpk_mode: cq-id-onlywas enabled.See https://github.com/cloudquery/cloudquery-private/pull/6902/commits/ef8762eb1f1a6624913e5ee9ff7a88e9e0944537
This PR adds a validation to ensure only either ones are defined, or not defined at all. This has to happen after the
TransformTablescall since columns can be configured manually as wellUse the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)