Files
SQLWorkbench/docs/PHASE72-REVIEWED-ROW-EDITING.md

20 lines
1.7 KiB
Markdown

# Phase 72 — Reviewed row editing
Select a row in the Result Grid and choose **Edit Selected Row…**. Edit values in the sheet, inspect the generated `UPDATE`, then select **Apply SQL Changes**. The sheet also supports copying the SQL without executing it.
## Scope and safeguards
- Enabled only for a simple `SELECT * FROM <table> [LIMIT …]` result with matching introspection metadata for a **base table** and a primary key. Joins, arbitrary projections and views are read-only.
- Primary-key columns are read-only. A primary key is used in the `WHERE` predicate; changed columns' original values are also checked to detect concurrent changes.
- Uses `UPDATE … LIMIT 1`; the SQL is shown before execution and never applied automatically.
- MySQL values are encoded as hexadecimal UTF-8 expressions to avoid quote escaping and SQL injection from entered text.
- Nullable fields displaying `NULL` are blocked when they are part of the update or predicate because the existing MySQL protocol collapses SQL NULL into the string `NULL`.
- The initial implementation edits values as text. Explicit NULL assignment, binary/BLOB editing, INSERT, DELETE and arbitrary joined-result editing are not supported.
- Refreshes the original query after successful execution; verify affected-row counts and the refreshed result. An UPDATE can affect zero rows if a concurrent change occurred.
## Verification on macOS
Build in Xcode and test a base table with a primary key, including quotes and backslashes in edited text, multiple rows, changed data since SELECT, read-only views, and a table without a primary key. Verify System/Light/Dark appearance.
No build or release scripts are included.