Documentation

SQL Table

SQL Table

The SQL Table is a paginated grid view over the rows of a single table, wrapped around an embedded SQL editor and a visual query builder. It supports browsing, sorting, per-cell inline edit, single-row insert/edit/delete via a modal, and batch update/delete on multi-row selections.

Beta

The activity carries a BETA banner in the header: "Read-only viewer for debugging. Not optimized for large datasets." Write actions (inline edit, insert, delete, batch) do work end-to-end, but treat this activity as a fast browser for now and reach for the SQL Editor for anything you'd want a rollback for. Large-table performance is a known limitation.

Quick Start

  1. Open a database in the sidebar and click a table name.
  2. The table opens with the first page of rows loaded. Click a column header to sort.
  3. Double-click any cell to edit it in place; press Enter to commit, Esc to cancel. The write is sent to the server immediately — there is no pending state or Save button.
  4. Toggle the Query Builder panel or the Custom SQL checkbox to shape the underlying query.

Opening a Table

  • From the schema tree, click a table name to open it in the grid.
  • Or open the activity from a SQL context menu — the table picker shows every table in the database and includes a Use Custom SQL escape hatch that skips picking a table and drops you straight into the editor.

Activity Layout

Three regions, top to bottom:

  • Toolbar — breadcrumb, refresh, Query Builder toggle, Import/Export, and menu overflow.
  • Embedded SQL editor — a read-only view of the query that produced the current results. Flip the Custom checkbox to unlock it and author the SQL yourself. See the Query Builder panel for the visual alternative that fills the editor for you.
  • Result grid — sortable columns, paged navigation, and per-cell inline edit.

Sorting & Pagination

  • Sort: Click a column header to toggle ASC, then DESC, then off. Sorting resets to the first page and re-runs the query.
  • Paging: The bottom bar has First / Previous / Next / Last controls and a page-size selector. Rows are fetched one page at a time — there's no virtual scrolling mode.

Inline Editing

Double-click a cell to edit its value in place. Cell inputs are type-aware where the driver reports type information (text, numeric, boolean, date/timestamp, enum, JSON/JSONB). Pressing Enter writes the change to the server immediately via an UPDATE ... WHERE <primary-key> = ...; a toast confirms the number of rows affected, and the row flashes green on success. Esc cancels before commit.

Inline edit only works when the grid can safely address the row — that means the base table is a real table (not a view), the query isn't in Custom SQL mode, and the primary-key columns are present in the projection. Otherwise the cell is not editable and the tooltip explains why.

Row Actions

  • Insert Row — opens a modal with fields for every column and any known foreign-key pickers; submits an INSERT.
  • Edit Row — same modal, pre-filled from the selected row.
  • Delete Row — confirms, then runs a DELETE ... WHERE <primary-key> = ....
  • Batch Update and Batch Delete — after selecting multiple rows, apply the same update to all of them or delete them together.
  • Copy as CSV, Import, Export — bulk-data conveniences on the toolbar / row menu.

Read-Only Connections

Inline edit, insert, delete, and batch actions all require the base table to be editable (real table, not a view, primary keys present, not in Custom SQL mode). If any condition fails, the affected affordance is hidden and its tooltip explains why. Server-side privileges still apply — see SQL User Management for how the connection's grants govern which of these will actually succeed.

Pro Tips

  1. Filter before you edit: Use the Query Builder panel to narrow the grid to the rows you actually need to touch — smaller results are safer and faster.
  2. Read the SQL: The embedded editor always shows the query producing the grid, so you can spot a bad filter or a missing join before you start clicking cells.
  3. Prefer batch update over per-row edits when applying the same change to many rows — one round trip, one row-count in the log, and it's much easier to notice a mistake before hitting Apply.
  4. Reach for the SQL Editor for anything transactional or destructive at scale. The Table activity commits each edit immediately; the SQL Editor lets you wrap changes in explicit transactions with ROLLBACK.

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial