Skip to content

Edit data safely ​

You can change, add and delete rows from the Data tab. Every change is written to the database the moment you confirm it, so this page starts with the precautions.

Editing production data

Database Manager has no undo, no draft mode and no "apply changes" step. Save in the row editor and Run in the Query tab change the live database immediately. A deleted row, or an UPDATE without a WHERE, cannot be taken back from inside the app.

Before you change data that matters ​

  • Take a backup first. Select Backup in the title bar and wait for Backup created. See Export and back up.
  • Check which connection is open. The connection name is in the title bar. Give production connections a name that stands out, such as PROD - orders.
  • Prefer a copy. Try the change on a test database or a restored backup first.
  • Use a limited account. Connect with a database user that has only the rights the task needs. For looking around, use a read-only user: the database then refuses every change.
  • Find the row before you edit it. Use the find-rows panel so that the row you click is the row you mean.
  • Write the WHERE first. In the Query tab, run a SELECT with your WHERE clause and check the rows it returns before you turn it into an UPDATE or DELETE.
  • Do not save production passwords. Turn on Ask for the password every time for those connections.

Edit a row ​

  1. On the Data tab, click any cell of the row, or select the pencil button (Edit row) at its right end.

  2. In the Edit row dialog, change the values you want. Each column has its own box.

  3. To set a column to no value, tick NULL next to it. The box is disabled while NULL is ticked. Untick it to type a value again.

  4. Select Save. A message confirms Row updated.

Select Cancel to close the dialog without changing anything.

How values are written:

  • Text that looks like a number is stored as a number. true and false are stored as boolean values. Everything else is stored as text.
  • An empty box stores empty text, which is not the same as NULL.
  • Save writes every column of the row, including the ones you did not touch.

WARNING

Avoid editing rows that contain binary data (shown as 0x…). The editor works with text, so the binary value may not be written back exactly as it was.

Insert a row ​

  1. Select Insert in the toolbar.

  2. In the Insert into dialog, fill in a value for each column.

  3. For a column the database should fill itself, such as an auto-numbered id in SQLite or MySQL, tick NULL.

  4. Select Save. A message confirms Row inserted.

If the database rejects the row, for example because a required column is empty, a message starts with Insert failed: and gives the database's reason. Nothing is added.

Delete a row ​

  1. Select the red bin button (Delete row) at the right end of the row.

  2. The app asks Delete row? and warns This cannot be undone.

  3. Select Delete to remove the row, or Cancel to keep it.

Rows that cannot be edited ​

The app must be able to identify one exact row to change it. When it cannot, it shows This row cannot be edited (no row identifier). This happens for SQLite views and for SQLite tables created WITHOUT ROWID. Change those with a statement in the Query tab.

For MySQL tables without a primary key, the app finds the row by matching all of its column values and changes one matching row. If the table holds identical duplicate rows, you cannot choose which copy is changed.

Differences between databases ​

  • MongoDB: _id is shown as (read-only) and cannot be changed. A value that is valid JSON, such as 42, true, ["a","b"] or {"x":1}, is stored as that JSON type. Anything else is stored as text.
  • LMDB: a row is a key and a value. A key is required. Changing the key of an existing entry removes the old key and writes the new one. Type 0x followed by hexadecimal digits to enter binary data.
  • Tables whose names you do not see: the table list for PostgreSQL covers the public schema. Use the Query tab for other schemas.

Next steps ​