Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ios/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Rows show as cards or as a grid. Pick **Cards** or **Grid** in a table's **More*
<img className="hidden dark:block" src="/images/ios-row-grid-dark.png" alt="Track table as a grid on iPhone, scrolled sideways with TrackId held at the left, beside the More menu with Grid checked under Cards" />
</Frame>

Search the table list by name. A PostgreSQL materialized view sits under **Views** and opens read only. Page a table at 50, 100, 200, or 500 rows, jump to a page number, sort by a column, search text columns, and stack filters with AND or OR.
Search the table list by name. A PostgreSQL materialized view sits under **Views** and opens read only. Page a table at 50, 100, 200, or 500 rows, jump to a page number, sort by a column, search text columns, and stack filters with AND or OR. On PostgreSQL, ClickHouse, SQL Server and Oracle, pages follow the primary key, after your sort when you pick one, so paging never repeats or skips a row. The search field types quotes and dashes as you key them, so `O'Brien` finds `O'Brien` with Smart Punctuation on.

To follow a foreign key, tap the link under its value on a row, or long-press a row in the list and pick the key. A sheet previews the row it points at, titled with the table and, when it differs from the one open, the schema. A value in the preview that is itself a foreign key opens the next row in the same sheet, and **Back** returns one step. **Open Table** opens that table filtered to the key, and when one row matches it lands on that row, ready to edit. **Back** then returns to the filtered list and to the row you started from. While that row has an edit open, **Open Table** is dimmed.

Expand Down Expand Up @@ -201,7 +201,9 @@ Suggestions fill the bar above the keyboard as you type, in front of the fixed k

Touch and hold **Run** for **Run All Statements**, which sends every statement in the editor in order. It is in the **More** menu too. On a hardware keyboard, `Cmd+Enter` runs the statement or the selection, `Cmd+Shift+Enter` runs every statement, and `Cmd+.` stops. On iPad the menu bar's **Query** menu lists **Run Statement**, **Run All Statements**, **Stop** and **Clear Query**, and its **View** menu switches sections with `Cmd+1` through `Cmd+4`.

Tap a query in **History** or **Saved Queries**, or a table under **SELECT * FROM ...** in the **More** menu, to add it to the editor. It fills an empty editor; otherwise it goes after your text as a statement of its own, with the cursor in it, and **Undo** takes it back. A statement that creates, alters or drops a table refreshes the table list in every window open on the connection.
On MySQL, MariaDB, TiDB, OceanBase and SQL Server, a `USE` you run moves the table list and the database menu to that database, and a dropped connection reconnects there; while a window has unsaved changes on the connection, the `USE` is undone and a message says why. Until a run with a `USE` ends and the menu has followed it, **Run** waits in every window. On MySQL, MariaDB, TiDB and OceanBase, **Tables** names the database the menu shows in every statement it sends. On SQL Server it does not, so saving, inserting, deleting, truncating and dropping there stop with a message while such a run is going, or while the session sits in another database than the menu shows. On PostgreSQL, a `SET search_path` you run, or a **Roll Back** that undoes one, moves the schema menu to the schema the session uses.

Tap a query in **History** or **Saved Queries**, or a table under **SELECT * FROM ...** in the **More** menu, to add it to the editor. It fills an empty editor; otherwise it goes after your text as a statement of its own, with the cursor in it, and **Undo** takes it back. A statement that creates, alters or drops a table refreshes the table list in every window open on the connection. **History** keeps the last 200 runs on the device, fewer once their text passes 2 MB, and drops the oldest first, so a script it shows is always whole.

<Frame caption="The band marks the statement Run sends">
<img className="block dark:hidden" src="/images/ios-query-run.png" alt="Query section with the second of three SELECT statements banded and its result b 2, beside the Run menu holding Run Statement and Run All Statements" />
Expand All @@ -212,11 +214,11 @@ Safe Mode reads only the text that runs, so a `SELECT` before an `UPDATE` runs w

On SQL Server, lines with no semicolon between them are one statement up to the next line holding only `GO`, so **Run** sends that batch. In a selection or **Run All Statements**, each `GO` line ends a batch, each batch goes to the server whole, and `GO 5` runs its batch five times.

On MongoDB the editor takes the shell JavaScript the Mac takes. A statement ends where the program's top level does, so a loop or a function body runs whole, and Safe Mode counts a statement as a read only when every call in it reads and its arguments are plain data: see [MongoDB](/databases/mongodb#writing-queries). `use analytics` moves the table list and the database menu along with it once the statement returns, a stopped one included. While another window has unsaved changes on the connection, the `use` is undone instead. Browsing and row edits always run in the database the menu names.
On MongoDB the editor takes the shell JavaScript the Mac takes. A statement ends where the program's top level does, so a loop or a function body runs whole, and Safe Mode counts a statement as a read only when every call in it reads and its arguments are plain data: see [MongoDB](/databases/mongodb#writing-queries). `use analytics` moves the table list and the database menu along with it once the statement returns, a stopped one included. While a window, this one included, has unsaved changes on the connection, the `use` is undone instead. Browsing and row edits always run in the database the menu names.

On Redis a command ends at a semicolon or at a line break outside quotes, so each line is its own command and a quoted value may run across lines. A command with an unclosed quote fails without running. Quotes and escapes read as they do on the Mac: see [Redis CLI](/databases/redis#redis-cli).

**Stop** cancels the running statement and starts no other. On MySQL and Redis the statement keeps running on the server until it finishes. Results copy or export as JSON, CSV, or SQL `INSERT`, which Redis and MongoDB leave out. A value shown in part, or a binary value, stops the copy or export with **Cannot Export**: leave that column out of the `SELECT`. A result too large for the memory left stops it with a message to return fewer rows. Copying rows from a table reads values over 4 KB in full first.
**Stop** cancels the running statement and starts no other. On MySQL and Redis the statement keeps running on the server until it finishes. Results copy or export as JSON, CSV, or SQL `INSERT`, which Redis and MongoDB leave out. In JSON, a numeric column gives numbers and a boolean column `true` or `false`; every other typed column gives strings, so a `VARCHAR` holding `1e10` or `true` stays text. A column with no type, such as `count(*)` on SQLite, gives a number or a boolean when its value reads as one. A value shown in part, or a binary value, stops the copy or export with **Cannot Export**: leave that column out of the `SELECT`. A result too large for the memory left stops it with a message to return fewer rows. Copying rows from a table reads values over 4 KB in full first.

A running query appears in a Live Activity on the lock screen and Dynamic Island, with the elapsed time and the row count so far. **Settings > Live Activities > Hide Query** replaces the SQL text there with "Running query". The card clears when the query ends. Quitting the app mid-query leaves it behind, marked interrupted, until the next launch clears it.

Expand Down
Loading