You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Grid looks up row keys on the editor tab's connection, not the result's #857
#840 (PR #856) made grid saves take their table, connection, database and session from the result. ResultsGrid.tsx still reads three things from the active editor tab's connection and database instead of the result's resultSource:
the row-key lookup (useRowKey);
the row count;
the column layout.
The row key is the one that matters. It picks the primary-key columns that the UPDATE/DELETE ... WHERE clauses use. If the tab has moved to another connection or database since the query ran, the key comes from a different server's table with the same name. The WHERE clause can then name the wrong columns, or match more rows than intended.
How to see it
Run SELECT * FROM t on connection A.
Point the editor tab at connection B, which has a table t with a different primary key.
Edit a cell and save. The key columns come from B's t.
Fix
Pass resultSource.connectionId and resultSource.database to useRowKey, the row count and the column layout. Refuse editing when resultSource is null, as the save already does.
Activity
fix(grid): read the row key on the result's source
fix(ux): editor, grid and results review fixes (#908)