-
Notifications
You must be signed in to change notification settings - Fork 404
[ui-importer] Add Primary key column in bulk column modal #4281
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
base: master
Are you sure you want to change the base?
Conversation
|
✅ Test files were modified. Ensure that the tests cover all relevant changes. ✅ |
| setEditableRows(rows => | ||
| rows.map((row, i) => ({ | ||
| ...row, | ||
| isPrimaryKey: i === rowIndex ? true : false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will limit having only one primary key at a time?
Do we have it by design?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. We don't have any design for it as of now. Do we need it? Like should I ask for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not make this the default. The user should be free to choose multiple columns as the primary key if the database supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semantics: I don't think there are any DB engines that support multiple Primary keys on a single table, it kind of defies the purpose (but I'm happy to be proven wrong).
However, you can have a composite primary key that consists out of multiple columns. So, lets first clarify what we want to achieve here
a) marking a simple column as primary key
b) also using the UI to create a composite primary key (which I think most engines support)
@JohanAhlen do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, I also meant the composite primary key, where we select two or more columns to make a single primary key.
| title: 'fixed_name', | ||
| type: 'STRING', | ||
| comment: 'comment1', | ||
| isPrimaryKey: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test with assertions for the case where this is true.
What changes were proposed in this pull request?
Add Primary key column in bulk column modal.
How was this patch tested?
Manual testing. Updated unit tests. Find the video of the change made attached.
Screen.Recording.2025-10-27.at.3.51.14.PM.mov
Please review Hue Contributing Guide before opening a pull request.