2.2. Edit mode

OrmFactory does not have a separate “edit mode”. Once table data has appeared in the Data area of a Query Window, you can start editing immediately.

Entering edit mode

You can enter a cell’s edit mode using any of the following shortcuts:

  • Enter – start editing the selected cell
  • F2 – start editing the selected cell
  • Double-click – start editing the clicked cell

Requirement: Any editable cell must belong to a table with a primary key (PK). OrmFactory needs the PK to generate UPDATE or DELETE statements.

For tables with joins, the same rule applies: only cells from rows with a PK can be edited. PKs are indicated in the grid header with a key icon if OrmFactory could detect them (from the query or model).

Keyboard shortcuts

Navigation mode keyboard shortcuts:

  • Left, Right, Up, Down - navigate between cells
  • PageUp, PageDown - scroll by one page of rows
  • Home, End or ⌘/Ctrl + Left, ⌘/Ctrl + Right - move cursor to first/last column
  • Shift + Home, Shift + End or ⌘/Ctrl + Up, ⌘/Ctrl + Down - move cursor to a first/last row
  • Enter, F2 - enter cell edit mode
  • ⌘/Ctrl + C, ⌘/Ctrl + Insert - copy cell value as text
  • ⌘/Ctrl + V, Shift + Insert - paste into current cell
  • Delete, Backspace - reset cell changes
  • Menu key or Application key - open context menu for the current cell

Edit cell mode shortcuts:

  • Enter - save and exit edit mode
  • Tab - save and move to next cell
  • Escape - discard changes and exit edit mode

Editing cells

Once a cell is changed, it is marked with an orange triangle in the top-left corner:

Editing cells in joined table

Editing a cell in a joined table updates all rows with the same PK value.

Changes can be applied, previewed, or discarded using the corresponding buttons:

  • Apply – executes changes directly in the database
  • Preview – shows generated SQL statements (UPDATE, DELETE, INSERT) without executing them
  • Discard – cancels changes

Preview is read-only: you cannot modify SQL there. Each statement is tied to its row, and Apply executes statements sequentially. If an error occurs for a row, that row’s changed cells turn red, and the tooltip shows the database error. Other rows continue applying normally.

Preview data change statements

Expressions

You can enter expressions into cells (e.g., SQL functions). These expressions are sent as-is to the database and evaluated there. If the OrmFactory cannot recognize the date, it considers the text to be an expression and sends it to the DBMS as is. Text fields cannot be an expression.

SQL expressions as cell values

Foreign key tooltip

Hovering over a foreign key (FK) cell shows a tooltip with data from the referenced object. The tooltip is recursive: you can point FK fields in the tooltip's cell to open nested references.

images/data_editor/foreign_key_tooltip.png

The Foreign key tooltip feature works with both real and virtual foreign keys.

Multiline editor

Multiline editor window

Multiline editor opens automatically for cells containing multiline text, or via context menu → Multiline Edit (for text cells only). Cells are marked with a return symbol.

The Multiline Editor supports syntax highlighting for XML and JSON:

Highlighted XML data in the multiline editor

JSON Prettify-on-the-fly

When OrmFactory detects a JSON format and recognizes it as minified, it will prettify the text and minify it back after changes. "Save minified" checkbox will appear, if OrmFactory will recognize text as JSON. This checkbox allows you to convert minified JSON to prettified and vice versa.

Prettified JSON text in multiline editor

Binary viewer

For binary columns, a View binary option appears in the context menu. The cell itself shows blob and cannot be edited. In the binary viewer, 16-byte values are displayed as GUIDs.

Binary viewer window

Insert rows

Always one empty row exists at the bottom of the grid. Filling any cell in this row creates a new insert. A new empty row appears automatically. Clearing cells in the last empty row removes the second empty row, ensuring there is strictly one empty row.

Delete rows

To delete a row, right-click and choose Delete Row:

Delete row from context menu

And yes, you can delete a row in a joined table the same way as you can edit a joined table cell. Marked for delete rows will be shown with red strikethrough. The delete operation can be canceled using the context menu on the marked row (Discard delete option). OrmFactory does not care if you want to change a cell before delete the whole row. It will generate update before delete. Delete and edit can be discarded separately from context menu.

Error handling

If an update fails, changed cells in affected row will show red triangles. Hover to see the error message.

Tooltip with SQL error message in failed updates

Other rows continue applying changes.

Data reloading

After update or insert has been applied, OrmFactory will reload exact state of the changed rows. It will replace all cells of changed rows, no matter was they been edited or not. Reloading the entire row is necessary if triggers were used or, for example, current_timestamp as a default expression. Deleted row will be removed from grid.

Reloading data after changes was applied