Skip to content

Conversation

@ananya-agarwal
Copy link
Collaborator

@ananya-agarwal ananya-agarwal commented Oct 6, 2025

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.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

✅ Test files were modified. Ensure that the tests cover all relevant changes. ✅

@ananya-agarwal ananya-agarwal requested review from JohanAhlen, bjornalm, ramprasadagarwal and tabraiz12 and removed request for bjornalm October 6, 2025 06:15
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

UI Code Coverage Report

Lines Statements Branches Functions
Coverage: 33%
39.89% (31314/78484) 31.57% (14618/46294) 25.9% (2358/9101)

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Coverage

Backend Code Coverage Report •
FileStmtsMissCoverMissing
TOTAL569042893549% 
report-only-changed-files is enabled. No files were changed during this commit :)

setEditableRows(rows =>
rows.map((row, i) => ({
...row,
isPrimaryKey: i === rowIndex ? true : false
Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Collaborator

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants