Chapter 5
Edit data
Change values right in the grid, add and delete rows, then look over exactly what Rowan will send before you commit it all at once.
How changes are staged#
When you edit a cell, add a row or delete one, nothing is written to the database yet. The change is staged: Rowan keeps it, tints it in the grid, and adds it to the workspace's pending changes.

While you have staged changes, the toolbar shows Discard, Preview and Commit.

When you commit, Rowan sends every staged change in one transaction, as parameterized statements. If any statement fails, the whole transaction is rolled back and nothing changes; Rowan shows which statement failed so you can fix it and try again.
Staged changes cover everything in the workspace: rows in every table tab and split pane, editable query results, and structure changes. They survive switching tabs, so you can edit several tables and commit them together.
To change the tint colors for new, modified and deleted rows, open Settings > Fonts & Colors.
Edit cells#
- Double-click a cell, or select it and press Enter, or just start typing.
- Type the new value.
- Press Enter to keep it, or Esc to cancel. Tab keeps it and moves to the next cell in the row.

To toggle a boolean, click its checkbox or press Space. To edit a long value, use Quick Look (CtrlEnter) or the right sidebar.
Set Value and the date picker#
Some values can't be typed as text. Press AltEnter, Alt-click a cell, or right-click it and choose Set Value. The menu offers only what fits the column:

DEFAULT and NOW() are sent as SQL keywords, never as text. With several cells selected, the value goes into all of them.
Insert, duplicate, paste and delete rows#
The code preview#
Before you commit, you can see the exact SQL Rowan will send. Click Preview in the toolbar, or press CtrlShiftP.

- Statements are grouped by table with a summary, such as
-- public.orders: 3 updated. Structure changes come first, then rows. - Each statement's values are listed beside it as
$1,$2and so on, because that's how they're sent. - What the preview shows is exactly what's sent; nothing is added or rewritten later.
- Statements that PostgreSQL can't run inside a transaction, such as
CREATE INDEX CONCURRENTLY, are listed after the commit, and the preview says so.
From the preview you can Discard, Commit, or choose Open in Window to keep the preview in a window of its own. That window follows every edit, undo and discard as you make them, and you can commit from there too. Press Esc or CtrlShiftP again to put the popover away.

Commit and discard#
- To commit, click Commit or press CtrlS. Every staged change in the workspace is sent in one transaction.
- To throw everything away, click Discard or press CtrlShiftDelete.
If a commit fails, Rowan rolls it back, opens the preview with the failed statement tinted, and offers Show Row to take you to the row that caused it. Your staged changes are still there to fix.
Every commit is also written to History with its statements, its values and, for updates and deletes, what each row held before (-- was: status = 'paid'). If you ever need to put a change back by hand, the old values are there.
If the connection uses Safe Mode, Rowan asks before the commit is sent, and may ask for the database password. See Safe Mode.
Undo and redo#
Press CtrlZ to undo the last staged change, and CtrlShiftZ or CtrlY to redo it. Undo covers cell edits, new, duplicated, pasted and deleted rows, and structure changes, in the order you made them. Once you've committed, the changes are in the database; use History's old values to reverse one.
Tables without a primary key#
Rowan only edits rows it can identify for certain, and that takes a primary key. A table without one opens read-only, with a note above the grid:

You can still browse, filter, copy and export its rows, and change them with SQL in the editor. To make the table editable, add a primary key in its Structure view.