Glass Power Tools
Browse the help
Help / Databases

Edit rows and structure

This page covers changing a table from its tab: editing, adding and deleting rows, pasting or importing a range, and changing columns, indexes and foreign keys. Every change is reviewed before it is written.

Important

Editing, deleting and pasting rows require the table to have a primary key. On a read-only service, every one of these changes is refused before it is sent.

Edit a row#

  1. In the Data view, double-click the row (double-tap on Vision Pro, iPad and iPhone), or choose Edit Row from the row number's context menu. The Edit Row editor opens, numbered for the row.
  2. Change fields. A field that allows NULL, and is not part of the primary key, has Set to NULL. JSON fields have Format and Validate, and a text field shows how much of the column's length is used once it is within 10 characters of the limit. A field the server generates is marked Generated by server.
  3. Choose Apply. The button counts the changed fields. Nothing is written yet.
  4. Read the change in Review Row Mutation and choose Commit, or Cancel.

On Mac: the review is a sheet that says no database write occurs until you choose Commit. On Vision Pro, iPad and iPhone: it is an alert with the same buttons.

The update identifies the row by its primary key and every value it had when the page loaded. If someone changed the row in the meantime, nothing is written and the change is refused. Reload the page and try again.

Choosing Cancel in the editor after making changes asks Discard Changes? with Keep Editing and Discard.

Add a row#

  1. Choose Add Row in the toolbar.
  2. Fill in the fields. A field with a default starts as Use default: and the value; choose Provide Value to type one, or Insert NULL where the column allows it. Use Column Default puts a field back. Fields left at their column default are not sent.
  3. Choose Insert, then Commit.

Delete rows#

  1. Select a row by its row number. On Mac, Shift-click or Command-click row numbers to select several.
  2. Choose Delete, or Delete Row… (Delete 3 Rows… for a selection) from a row number's context menu. On iPhone, and in a narrow iPad window: choose More ▸ Delete Selected Rows….
  3. Choose Commit.

The rows are deleted in one transaction. If any of them changed since the page loaded, none is deleted.

Paste or import a range#

  1. Select the cell where the range should start.
  2. Choose More (…) ▸ Paste Rows to use the clipboard, or More ▸ Import TSV… to choose a UTF-8 tab-separated file of up to 10 MB. On iPhone, iPad and Vision Pro, the system asks before the app reads what another app copied.
  3. Turn on More ▸ First Row Is Column Names when the first line holds column names; they are matched to the table's columns by name, hidden ones included. Otherwise columns are matched from the selected cell.
  4. Choose Stage Paste after checking the preview, then Commit.

A pasted range updates rows already loaded, starting at the selected cell; it does not add rows. It must fit the loaded rows and visible columns. \N pastes NULL, which a NOT NULL column refuses, and a column the server generates refuses a paste.

Change columns, indexes and foreign keys#

  • Structure lists the columns. Choose Add Column, or open a column's menu for Edit Column… and Drop Column…. On SQLite, Edit Column… can only rename a column, because SQLite changes a column's type, nullability or default only by rebuilding the table.
  • Indexes lists the indexes, marked PRIMARY or UNIQUE. Choose Add Index, or the drop button on an index.
  • Foreign Keys lists relationships. Choose Add Foreign Key, or the drop button on one. For SQLite these two are unavailable, because SQLite changes foreign keys only by rebuilding the table.

Each sheet ends with Review, which shows the generated SQL. Choose Apply to run it. A change that can remove stored data is marked This change can remove stored data. The engine decides whether a schema change can be rolled back.

DDL shows the server's CREATE TABLE statement for MySQL and SQLite, with Copy and Open as SQL. PostgreSQL does not provide one; use the other three views instead.

Where changes are recorded#

Row changes, schema changes and data-changing statements run from a table's SQL editor are listed in the Mutation Log, opened from the schema browser's toolbar. See The database workspace.


Something wrong or missing? This help is written from the app's own code and is in the repository; corrections are welcome.