Working with Data
Browse, select, copy and edit rows in the data grid, then commit every change in one transaction.
When you open a table, its rows appear in the data grid. You can sort and hide columns, copy data in several formats, and edit cells and rows. Edits stay pending until you commit them.
Grid basics
The grid shows one page of rows at a time, with row numbers on the left. Numbers are right-aligned, NULL values are dimmed, and the data uses a monospaced font. Use the filter bar to narrow the rows down and page through them.
Sort
Click a column header to sort by that column. Each click cycles through ascending, descending and off.
Show and hide columns
Right-click any column header to see the list of columns. Uncheck a column to hide it, or choose Show All Columns to bring them all back. Hidden columns are also left out of exports by default.
Status dots
In enum columns and text columns with few distinct values, Mantidb draws a small colored dot before common status words:
| Color | Example values |
|---|---|
| Green | paid, active, success, completed, done, approved, delivered, open, live, published, true, yes |
| Amber | pending, processing, queued, draft, in_progress, scheduled, trialing |
| Red | failed, error, cancelled, canceled, rejected, declined, expired, blocked, deleted, past_due, unpaid, false, no |
Selecting and copying
Click a row to select it, or click a single cell to start a cell selection.
⇧-click or drag to select a rectangle of cells.⇧+ arrow keys grow the selection; arrow keys move it.Escgoes back to selecting whole rows.⌘-click selects rows as usual.
Press ⌘C to copy. A single cell copies its raw value; a block of cells or whole rows copy as tab-separated values (TSV), ready to paste into a spreadsheet.
Right-click the selection for more formats:
| Item | Copies |
|---|---|
| Copy | Tab-separated values. |
| Copy with Column Names | Tab-separated values with a header row. |
| Copy As ▸ CSV | Comma-separated values. |
| Copy As ▸ JSON | An array of objects, keeping types (null, booleans, numbers). |
| Copy As ▸ SQL INSERT | INSERT statements with the table's full name, in the connection's SQL dialect. |
In TSV and CSV, NULL becomes an empty field and empty text becomes "". Binary values are copied as 0x… hex.
Editing cells
Double-click a cell, or select it and press ↩, to edit it. With a whole row selected, ↩ edits its first visible column. Edited cells turn amber.
To set a cell to NULL, right-click it and choose Set NULL, or use the … menu in the row inspector.
You can also paste with ⌘V: tab-separated data from the clipboard is pasted into the selected cells as pending changes.
Adding and deleting rows
- Add a row with
⌘I, the + Row button in the bottom bar, or Add Row in the context menu. Untouched cells showDEFAULT, so the server's default values apply. - Delete rows by selecting them and pressing
Delete(or⌦), or with Delete Row in the context menu. Marked rows are struck through.
Deleting is a toggle: select a marked row and press Delete again, or choose Restore Row, to unmark it. Deleting a row you just added simply removes it.
Commit, discard and preview
Nothing is written to the database until you commit.
- Commit — press
⌘S, click Commit in the bottom bar, or choose File ▸ Commit Changes. Every pending update, insert and delete runs in one transaction, after the safe mode check. - Discard — click Discard in the bottom bar or choose File ▸ Discard Changes to throw away every pending change.
- Preview — click Preview in the bottom bar to see the exact SQL that will run.
JSON cells are validated again before the commit. If any are invalid, Mantidb lists the columns with errors and doesn't commit.
If you change table, page or sort with pending changes, Mantidb asks Discard N unsaved change(s)? first. Commit them with ⌘S to keep them.
Views can't be edited, and nothing can be edited on a connection in Read only safe mode. Hover over the disabled + Row button to see why.
Cell editors
For some column types, Mantidb opens a dedicated editor in a popover. Right-click a cell and choose Edit JSON…, Edit Date… or View Bytes… (or View JSON… and View Date… when the table is read-only). Press Space to open Quick Look for the focused cell.
In every editor, ⌘↩ saves and Esc cancels.
JSON
For json and jsonb columns.
- The text is validated as you type: Valid JSON, or the line and column of the error. Save is disabled while the JSON is invalid.
- Format pretty-prints with 2-space indentation; Minify compacts it. Numbers, key order and duplicate keys are preserved.
- Set NULL and Quick Look are also available.
Saving from the JSON editor stores the text as it's shown, so the original compact formatting is replaced.
Date and time
For date, time, timetz, timestamp, timestamptz, datetime, datetime2, smalldatetime and datetimeoffset columns.
- A calendar and a clock with seconds, in UTC.
- Now sets the current date and time.
- You can also edit the literal value as text.
- Values the picker can't show, like
infinity, are sent to the server exactly as typed.
Binary
For bytea, blob, binary, varbinary and image columns, and SQLite blobs.
- View the value as a hex dump, as text or as an image.
- Only the first 1 MB is shown; Quick Look or Save As… gives you the whole value.
- Edit Hex lets you type a new value, written like
0xCAFE. - Load File… replaces the value with a file's contents; Save As… writes it to a file.
- Set NULL, Quick Look and Done.
There's no dropdown for enum columns. Type the value as text.
Tables without a primary key
Mantidb normally identifies rows by their primary key. When a table doesn't have one, it uses the row's physical address instead, and the bottom bar shows No primary key · rows matched by ctid (or rowid).
| Engine | Rows matched by |
|---|---|
| PostgreSQL | ctid |
| CockroachDB | The hidden rowid column |
| SQLite | rowid |
A row's physical address can change when it's updated or when the table is rewritten, so Mantidb reloads the page after every commit. If any edited row no longer matches exactly one row, the whole commit is rolled back.
On MySQL / MariaDB, SQL Server and Redshift, existing rows in a table without a primary key can't be edited or deleted. You can still add new rows.
Foreign-key navigation
Cells in a foreign-key column show a small arrow.
- Click the arrow to open the referenced table, filtered to the matching row. For composite keys, the filter uses every column of the key. The tab you came from stays open, and Back returns to it.
- ⌥-click the arrow, or choose Peek Referenced Row in the context menu, to see the referenced row in a popover without leaving the table. Click Open to go to it.
- The context menu also has Open <referenced table>.
Foreign-key navigation works on PostgreSQL (including compatible engines), MySQL / MariaDB, SQL Server and SQLite.
