Write mode & edits

The read-only default, impact previews, typed production confirmations, inline edits, structure changes, CSV import, and transactions.

A write confirmation showing Matches 1 of 80 rows before commit

Row Patrol is read-only until you say otherwise, and careful after that.

Read-only by default

The toolbar shows Read-only on every connection. Click it to switch to Writing.

  • On development and staging that is one click.
  • On production you must type the connection's name first, and the window stays red.
  • Reconnecting, closing the tab or restarting always returns to read-only. Writing mode is never remembered.

Even in Writing mode, plain reads still run on the read-only session. Only statements that actually change something go through the writer.

What is allowed, and what never is

Writing mode allows ordinary data changes (INSERT, UPDATE, DELETE, MERGE), table and index changes (CREATE, ALTER, DROP), SET for session settings, and ANALYZE.

It always refuses the things that affect a whole server or its security: creating or dropping databases, managing users and roles, GRANT and REVOKE, extensions, foreign servers, publications and tablespaces. If you need one of those, run it outside Row Patrol.

Every write shows its impact first

Before anything commits you get a confirmation with the exact SQL and a plain summary:

  • Simple updates and deletes show Matches N of M rows, counted by a read-only query first.
  • Inserts show how many rows they will add.
  • A change with no WHERE, or one that touches every row, shows a red warning and, on production, needs you to type ALL ROWS before the button unlocks.
  • DROP and TRUNCATE need you to type DROP or TRUNCATE, on every connection.
  • Stored procedures and DO blocks, whose effect cannot be predicted, need you to type CALL or DO.

On SQLite, PostgreSQL and SQL Server the whole confirmed change runs in one transaction, so an error rolls back everything. MySQL and MariaDB commit each schema change as it happens; Row Patrol tells you when that is the case.

Edit rows in the grid

In a table's Data view with Writing on:

  • Double-click a cell, or press F2, to edit it. Enter keeps the change, Esc abandons it, Delete sets the value to NULL.
  • Ctrl+Shift+N adds a row. Untouched columns keep the database's own defaults.
  • Ctrl+Delete marks rows for deletion.
  • Ctrl+Z undoes the last change; Discard edits throws them all away.

Nothing is written until you click Review & commit, which opens the same confirmation dialog with the exact statements in the order they will run.

The Inspector's Row view edits the same values, which is easier on wide tables and when filling in a new row.

Change a table's structure

In a table's Columns view, click Edit structure to draft column and index changes: rename, add or drop columns, change types, nullability and defaults, and add or drop indexes. You see the statements before they run, and nothing changes if the database rejects them.

Create table... in the command palette designs a new table in a form, with a live SQL preview before you commit it.

SQL Server does not support structure editing yet; write the ALTER TABLE statement yourself.

Import a CSV file

In Writing mode, Import CSV into table… adds rows to an existing table. Pick the file, choose the delimiter and how empty fields should be read, map the columns, and preview. Existing rows are never changed or deleted. On production you type IMPORT to confirm.

Transactions

Begin transaction starts an explicit transaction on the writer session, and the toolbar shows a Transaction badge with Commit and Roll back. Confirmed writes and inline edits join the open transaction until you commit, and that tab's queries read your uncommitted changes so you can check them first.

The audit log

Every confirmed write, row edit, structure change, import, restore and agent or MCP data read is recorded in a local audit log, with the connection and row counts. Export it as CSV or JSON Lines from the agent settings when you need a record of what happened. It lives on your machine and is not tamper-proof.