Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion developers/mcp-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Statements that read or write files, or that run server-side code, are refused o
| `switch_database` | `connection_id`, `database` | `status` (`switched`), `connection_id`, `current_database` |
| `switch_schema` | `connection_id`, `schema` | `status` (`switched`), `connection_id`, `current_schema` |

`switch_database` and `switch_schema` move what the user sees: the sidebar, and the tab strip, which lists the tabs of the database or schema the connection is on. The user's other tabs stay open under their own database.

`list_connections` omits connections blocked for external clients, connections whose AI policy is **Never**, and connections outside the token's allowlist. Its `database` is the session's browsed database when connected, the saved default otherwise.

The labels the user gave a connection come with it, so a client can show the list the way the app does:
Expand Down Expand Up @@ -235,7 +237,7 @@ These read and drive the TablePro app itself, and none of them bypasses the conn

Starred tables are a good hint at what matters in a database. `list_recent_tabs` covers every readable connection when `connection_id` is omitted, its `limit` runs 1 to 500, default 20, and `tab_type` is one of `query`, `table`, `createTable`, `erDiagram`, `serverDashboard`, `insights`, `usersRoles`.

`open_connection_window` and `open_table_tab` connect first if they have to, and return once the window has a tab or fail after 8 seconds.
`open_connection_window` and `open_table_tab` connect first if they have to, and return once the window has a tab or fail after 8 seconds. `open_table_tab` without `database_name` or `schema_name` means the ones the connection is on, and its `tab_id` is that table's tab, never a table of the same name elsewhere.

`search_query_history` searches the history TablePro keeps on this Mac. Pass `""` to match everything and filter by date alone; `since` and `until` are Unix epoch seconds, and `limit` runs 1 to 500, default 50. Results cover only connections this client may reach, with or without `connection_id`.

Expand Down
2 changes: 1 addition & 1 deletion features/keyboard-shortcuts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ See [Filtering](/features/filtering) for the filter bar itself.

## Tabs and windows

`Cmd+W` closes whatever is in front. In a connection window that is the current editor tab, and the File menu reads **Close Tab**. Settings, MCP Activity, a JSON or PHP viewer, and the welcome window have no tabs, so it closes the window and the menu reads **Close Window**. While the connections strip holds the keyboard it closes the highlighted entry, and the menu names it; an entry that is its connection's last one takes the connection with it.
`Cmd+W` closes whatever is in front. In a connection window that is the current editor tab, and the File menu reads **Close Tab**. Settings, MCP Activity, a JSON or PHP viewer, and the welcome window have no tabs, so it closes the window and the menu reads **Close Window**. While the connections strip holds the keyboard it closes the highlighted entry, and so it does when the database you are on has no tab left; the menu names the entry, and an entry that is its connection's last one takes the connection with it. `Cmd+1` through `Cmd+9` count the tabs in the strip, which are the current database's.

| Action | Shortcut |
|--------|----------|
Expand Down
10 changes: 5 additions & 5 deletions features/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Each tab keeps its own SQL, results, sorting, and filters, and come

Open a table while the sidebar is on `app` and that tab keeps querying `app`, and its schema, for the rest of its life. Changing the database in the sidebar moves what the sidebar lists and where the next tab opens; it retargets nothing already open.

The tab strip sits below the toolbar and lists only the current connection's tabs. One tab, no strip. [Agent mode](/features/agent-mode) hides it too, along with the content it lists.
The tab strip sits below the toolbar and lists the tabs of the database you are on, the entry highlighted in the [connections strip](/features/workspace-rail). Each database keeps its own tabs, and switching to another one shows its tabs instead. Server-wide tabs, such as Server Dashboard and Users & Roles, show in every database. One tab, no strip. [Agent mode](/features/agent-mode) hides it too, along with the content it lists.

Tabs are named after the object they show. When two would draw the same name, both gain their database: two tables called `orders` become `app.orders` and `staging.orders`. A name nothing else uses stays short, and hovering names the database either way.

Expand Down Expand Up @@ -56,12 +56,12 @@ A preview tab turns permanent as soon as you sort it, filter it, or edit data, a
|--------|-----|
| Close one tab | `Cmd+W`, the tab's close button, a middle-click anywhere on the tab, or **Close Tab** on its contextual menu |
| Close the rest | **File > Close Other Tabs**, also on the tab's contextual menu |
| Close every tab for this connection | **File > Close All Tabs**, also on the tab's contextual menu |
| Close every tab for this database | **File > Close All Tabs**, also on the tab's contextual menu |
| Close tabs bound to another database | **File > Close Tabs for Other Databases** |

Closing the last tab leaves the connection open on its empty state. `Cmd+W` again closes the connection; [Keyboard Shortcuts](/features/keyboard-shortcuts#tabs-and-windows) has the rest of that cascade.
Close Other Tabs and Close All Tabs act on the tabs in the strip, never on another database's. Closing the last tab leaves the database open on its empty state. `Cmd+W` again closes that database's entry in the connections strip, and the connection once it was its only one; [Keyboard Shortcuts](/features/keyboard-shortcuts#tabs-and-windows) has the rest of that cascade.

**Close Tabs for Other Databases** takes only tabs opened against a database other than the one the connection is browsing now, never the tab in front of you, and never another connection's tabs. On engines that switch schemas instead, such as BigQuery, Spanner and Oracle, it reads **Close Tabs for Other Schemas**.
**Close Tabs for Other Databases** takes every tab of the connection's other databases, never the tab in front of you, and never another connection's tabs. On engines that switch schemas instead, such as BigQuery, Spanner and Oracle, it reads **Close Tabs for Other Schemas**.

Closing asks **Do you want to save changes?** when the tab holds unsaved cell edits, a `.sql` file that differs from disk, or staged structure, Create Table, or user and role changes. Save closes the tab once the save lands, except for user and role changes, where it opens the review sheet instead and leaves the tab open. Closing one tab selects it first, putting the work in front of you before you answer. Once it closes, or you cancel, the tab you were on comes back to the front.

Expand Down Expand Up @@ -128,7 +128,7 @@ Loaded rows are the exception, and only in bulk. Background table tabs keep thei

## Where a tab points

A tab is bound to one connection, database, and schema, and every query, refresh, filter, sort, structure read, and structure save it runs uses that binding. Switching tabs never changes the connection's saved default database. To point an existing tab somewhere else, use the database picker in the query editor's toolbar: it rebinds that one tab, and reruns it when it was showing rows. A statement that writes asks before it runs. To point it at another connection, [move the tab](#moving-a-query-tab-to-another-connection).
A tab is bound to one connection, database, and schema, and every query, refresh, filter, sort, structure read, and structure save it runs uses that binding. Switching tabs never changes the connection's saved default database. To point an existing tab somewhere else, use the database picker in the query editor's toolbar, a schema picker on servers that switch schemas: it moves that one tab to the other database or schema, the window goes with it, and it reruns the tab when it was showing rows. A statement that writes asks before it runs. To point it at another connection, [move the tab](#moving-a-query-tab-to-another-connection).

The centred toolbar control names the frontmost tab's database, and clicking it switches to another. That is how you tell two tabs on one connection apart. On engines with schemas, **Database > Schema** names the one in use and switches it.

Expand Down
12 changes: 7 additions & 5 deletions features/workspace-rail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Connections strip
description: Switch between every connection and database you have open from a narrow strip on the leading edge of the window
---

Click an icon in the strip down the leading edge and you land back where you left off, on the tab you last used there. Each icon is one connection plus the database you are browsing in it, so two connections make two icons and moving one to a second database makes three. Clicking an entry returns you to it on the tab you last used there, and closes nothing.
Click an icon in the strip down the leading edge and you land back where you left off, on the tab you last used there. Each icon is one connection plus a database in it, and each has its own tabs, so two connections make two icons and moving one to a second database makes three. Clicking an entry shows its tabs, returns you to the one you last used there, and closes nothing.

<Frame caption="The connections strip beside the object browser, with two connections open">
<img className="block dark:hidden" src="/images/workspace-rail.png" alt="Connections strip" />
Expand Down Expand Up @@ -40,11 +40,13 @@ Switching database adds an entry and keeps the one you are leaving, so both data
| Back to `app` from the strip | Both stay, `app` is current |
| `logs` is already listed | The existing `logs` entry activates |

Closing an entry's last tab leaves the entry where it is: tabs and entries close separately. The set is per session, so relaunching starts from the database each connection opens on, plus the databases your restored tabs have work in.
Closing an entry's last tab leaves the entry where it is, with no tabs: tabs and entries close separately. A database with a tab open is always listed, since its entry is the only way to that tab. The set is per session, so relaunching starts from the database each connection opens on, plus every database your restored tabs are in.

## Switching

Between two connections, the window switches connection and returns you to the tab you last used there; between two databases of one connection, the sidebar moves and the tabs stay. An entry with nothing open moves the sidebar only, and clicking the entry you are in does nothing. No tab is ever closed or retargeted by a switch: each one keeps querying the database it was opened against.
Each entry keeps its own tabs. Clicking one shows its tabs and returns you to the one you last used there, and the sidebar follows to its database; the other entries keep their tabs until you come back. An entry with no tabs shows the empty tab area. Switching database from the toolbar, **Database > Open Database…** or the sidebar lands on that database's entry the same way, and picking a tab of another database, from `Ctrl+Tab` or **File > Reopen Closed Tab**, takes you to its entry. No tab is ever closed or retargeted by a switch: each one keeps querying the database it was opened against.

Moving between schemas inside one database, such as PostgreSQL's, keeps the entry and its tabs. Tables of the same name in two schemas are told apart by their schema-qualified tab titles.

On PostgreSQL, Redshift, and CockroachDB every database entry keeps its own server connection, so moving between two entries reconnects nothing and leaves each database's open transaction and temp tables where they were. Closing an entry closes its connection and rolls back a transaction still open there, so it asks first when there is one.

Expand All @@ -54,15 +56,15 @@ More entries than fit the window means the strip scrolls, and it settles on whol

## Windows

One window hosts every connection you have open, and the tab strip below the toolbar lists only the current connection's tabs. Opening a table or query on a connection already open adds a tab there rather than opening a second window.
One window hosts every connection you have open, and the tab strip below the toolbar lists only the tabs of the entry you are on: one connection and one database, or one schema on servers that group objects by schema. Opening a table or query on a connection already open adds a tab there rather than opening a second window.

To put two connections side by side, right-click an entry and choose **Open in New Window**. It moves with its tabs, its session, and anything unsaved. The item is absent when the window has no other connection left to show.

A first window opens at 1200x800 and goes no smaller than 720x480; later windows reuse the last size and position. Whether a new one joins a tab group follows **Prefer tabs when opening documents** in System Settings > Desktop & Dock. Inside a group, **Window > Show Previous Window Tab**, **Window > Show Next Window Tab**, **Window > Move Tab to New Window** and **Window > Merge All Windows** apply; all four dim outside one. `Ctrl+Tab` goes to editor tabs first and switches window tabs only when the window has no other editor tab to go to. Those are macOS window tabs, which hold whole windows, not the editor tab strip, which holds one connection's editors.

## Closing and disconnecting

Right-click an entry and choose **Close Database “\<name\>”** to close that database: its tabs go, its entry goes, and the connection keeps everything it has open elsewhere. Unsaved work in those tabs is confirmed first, and the strip lands on the next entry. Middle-clicking does the same without the menu, and so does `Cmd+W` while the strip holds the keyboard. On servers that group objects by schema the item reads **Close Schema “\<name\>”**.
Right-click an entry and choose **Close Database “\<name\>”** to close that database: its tabs go, its entry goes, and the connection keeps everything it has open elsewhere. Unsaved work in those tabs is confirmed first, and the strip lands on the next entry. Middle-clicking does the same without the menu, and so does `Cmd+W` while the strip holds the keyboard, or while the entry you are on has no tab left. On servers that group objects by schema the item reads **Close Schema “\<name\>”**.

**Close Connection “\<name\>”**, below it, closes the whole connection: every tab across every database it has open, its session, and all of its entries. The window closes too if that was its last connection, and **File > Close Connection** does the same for the connection on screen. A connection down to one entry has nothing else left, so closing that entry closes it. Nothing is lost for good: reopen the connection, from the connection list or **Database > Switch Connection…**, and its tabs come back as they were.

Expand Down
Loading