Skip to content

fix(grid): staged edits cannot hit the wrong row when a column is aliased to a key name (#1772) - #1803

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
fix/grid-aliased-pk
Oct 25, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
fix/grid-aliased-pk

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1772.

  • sqlResultGridSaveEnabled now also reads the select list: a primary key counts only when the result has it as a plain column of the table (id, t.id, \"id\", id AS id) or the list holds a *. SELECT number AS id, name FROM t, id + 0 AS id or CAST(number AS int) AS id no longer enable Save (an UPDATE keyed on that id could change another row, and the one-row check passes when the value matches exactly one).
  • TableMutationEngine._hasMatchingPrimaryKey uses every instead of any, so the preview warns when only part of a composite key is selected.
  • Tests: aliased and expression columns, columns kept as they are, composite key. The check works on the SQL text, not on driver metadata, so an exotic select list is treated as not keyed (Save off) rather than guessed. Not run locally, CI will.

… an expression; a composite key needs every column (#1772)
@github-actions github-actions Bot added bug Something isn't working data-grid Interactive data grid, cell editor, filtering, groupings P3 Low priority / Polish & Enhancements labels Oct 25, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 3802b45 into dev Oct 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working data-grid Interactive data grid, cell editor, filtering, groupings P3 Low priority / Polish & Enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant