Tabellum for mobile · Chapter 4
Writing SQL
4.1 The query tab#
Tap + above the tabs (or New query tab in the palette) for an editor on the connection chosen at its top. Type SQL and tap Run: Tabellum runs the selection if there is one, otherwise the statement under the cursor. The buttons next to Run format the SQL, save the tab as a file in queries/, and show the query plan.
While a query runs, Run becomes a red Stop button that counts the seconds.
4.2 Completion#
The editor completes as you type, and it knows both the database’s dialect and your schema: tables, columns of the tables the statement names (with their aliases), functions with their arguments, and whole join conditions along foreign keys. After ON, the joins the foreign keys allow come first. Tap a suggestion to insert it.
4.3 Parameters#
A query can have named parameters — :since, $1 or @name, as the database writes them. Before it runs, Tabellum asks for their values and passes them to the database separately, so they are never pasted into the SQL.

4.4 The query plan#
The plan button asks the database how it would run the statement and shows the answer as a tree. Each step has a bar for its share of the cost, the costliest steps are highlighted, and the database’s own output is a tap away. Tap it again to go back to the rows without running anything.

4.5 The command palette#
The search button in the title bar opens the palette: type a few letters of a connection, table, saved query or command and tap the result.

4.6 The approval dialog#
Tabellum reads every statement before it runs. Anything it cannot prove to be a read — UPDATE, DELETE, INSERT, CREATE, ALTER, DROP — stops at an approval dialog that shows the statements, their kind 1 and, where the database can tell, how many rows they would change.

- What kind of statement it is
- Run it, all or nothing
Run in transaction 2 runs them all or none. Before a statement that changes the schema, the dialog offers to back up first. This dialog is the same whether you typed the SQL, edited cells, applied a design or the AI agent proposed it.