diff --git a/connections/connection-form.mdx b/connections/connection-form.mdx
index f711771..bbaabae 100644
--- a/connections/connection-form.mdx
+++ b/connections/connection-form.mdx
@@ -16,7 +16,7 @@ The editor's sidebar lists the same four sections whatever the driver. Only Netw
|------|----------|
| **General** | Name, database type, host, port, database, credentials |
| **Network** | How the connection reaches the server, and how it is encrypted |
-| **Options** | Timeouts, driver options, startup SQL, Safe Mode, external and AI access, iCloud |
+| **Options** | Timeouts, driver options, startup SQL, Safe Mode, Manual Commit, external and AI access, iCloud |
| **Appearance** | Icon, color, tags, group |
The bar along the bottom carries **Test Connection**, **Cancel** and **Save**, plus **Save & Connect** on a new connection and **Delete** on a saved one. The space to their left holds the reason **Save** is dimmed, prefixed with the tab that holds the empty field, or the warning the last test brought back from the server.
@@ -67,7 +67,7 @@ Encryption sits below the transport. [SSL/TLS](/connections/ssl) covers the mode
## Options
-**Safe Mode**, **AI Policy** and **External Clients** share the **Access** section.
+**Safe Mode**, **Manual Commit**, **AI Policy** and **External Clients** share the **Access** section.
| Field | Description |
|-------|-------------|
@@ -82,6 +82,7 @@ Encryption sits below the transport. [SSL/TLS](/connections/ssl) covers the mode
| **Timeout** | Seconds each connection script may run. Empty uses 10; valid values are 1 to 300 |
| **Post-Disconnect Script** | Shell script run once the session ends, after a pre-connect script ran. See [Connection scripts](#connection-scripts) |
| **Safe Mode** | Confirms, authenticates or refuses queries before they run. See [Safe Mode](/features/safe-mode) |
+| **Manual Commit** | Off by default. On, the first change opens a transaction and nothing is saved until you commit it. **Database > Manual Commit** is the same setting. Dimmed on engines that commit schema changes on their own. See [Manual Commit](/features/sql-editor#manual-commit) |
| **AI Policy** | Per-connection override for the in-app AI agents. **Never** also refuses external clients. Shown while **Enable AI Features** is on |
| **External Clients** | **Blocked**, **Read Only** (the default), or **Read & Write** for MCP clients such as Raycast, Cursor, and Claude Desktop, and for [AppleScript](/developers/applescript) and [Shortcuts](/integrations/shortcuts). A token's own scope cannot raise it. See the [integration security model](/developers#security-model) |
| **AI Rules** | Guidance the AI reads on every chat turn for this connection: table conventions, columns to avoid, join hints. Shown while **Enable AI Features** is on. See [AI Assistant](/features/ai-assistant) |
diff --git a/customization/data-settings.mdx b/customization/data-settings.mdx
index abe1fb6..58cb938 100644
--- a/customization/data-settings.mdx
+++ b/customization/data-settings.mdx
@@ -77,7 +77,7 @@ Switching modes inside the viewer writes the choice back to this setting. See [J
| **Maximum entries** | 10,000 | 100 to 10,000, or Unlimited |
| **Keep entries for** | 90 days | 7 days to 1 year, or Forever |
| **Auto cleanup** | On | Applies the two limits in this table. Turn it off and nothing is pruned. |
-| **Clear History…** | - | Wipe all history, for every connection, after confirmation. Also clears the saved changes below. |
+| **Clear History…** | - | Wipe all history, for every connection, after confirmation. Also clears the saved changes below and the [earlier versions](/features/sql-editor#earlier-versions) of query tabs. |
To clear only what you are looking at, use the trash button in the history drawer instead: it respects the drawer's connection scope and date range.
diff --git a/developers/mcp-tools.mdx b/developers/mcp-tools.mdx
index ff38a8b..ef2468b 100644
--- a/developers/mcp-tools.mdx
+++ b/developers/mcp-tools.mdx
@@ -181,6 +181,15 @@ On SQL Server, send the whole script instead. A variable exists only in the batc
The top-level fields describe the first result set, with `rows_affected` counting the whole script. When the script returns more than one result set, `result_sets[]` lists every one in order, each with `columns`, `rows`, `row_count` and `is_truncated`. `max_rows` caps each result set on its own. `status_message` says when the script left a transaction open.
+A statement runs on the user's own session, inside any transaction it holds. `execute_query`, `confirm_destructive_operation` and [`insert_rows`](#writing-data) follow these rules about it:
+
+- A statement that starts a transaction while one is open is refused, with or without Manual Commit.
+- While a transaction is open on PostgreSQL or CockroachDB, the statement runs inside `SAVEPOINT tablepro_agent`. A failure rolls back to the savepoint and leaves the user's transaction usable. On Redshift and DuckDB, where a failure would abort it, the statement is refused.
+- With [Manual Commit](/features/sql-editor#manual-commit) on, a write stays pending until the user commits it in TablePro. It opens a transaction, or joins the one already open, and `status_message` says the change is pending. A write the connection cannot hold is refused.
+- With Manual Commit on, a statement that starts, ends or could hide transaction control is refused: `BEGIN`, `COMMIT`, `ROLLBACK`, `SAVEPOINT`, `RELEASE`, a procedure call, dynamic SQL, and on SQL Server a transaction keyword anywhere in the batch.
+- When the open transaction ended while the statement ran, `status_message` says so.
+- An `insert_rows` call of several rows that joins an open transaction on PostgreSQL, CockroachDB, MySQL, MariaDB, SQLite, SQL Server or Oracle runs inside a savepoint, so a row that fails takes back the rows before it.
+
A batch that raises an error fails the call with the server's message and line number. The batches after it do not run, and the error says what stays applied. On a connection with [masking rules](#masking-rules), the whole message is withheld.
### `explain_query`
@@ -199,12 +208,14 @@ Formats are `csv`, `json` and `sql`; pass exactly one of `query` or `tables[]`.
| `confirm_destructive_operation` | `connection_id`, `query` (`timeout_seconds`, `database`, `schema`) | A result set, plus `result_sets[]` for a SQL Server script |
| `transaction_control` | `connection_id`, `action` (`database`, `schema`) | `status`, the action that completed, and `connection_id` |
-`insert_rows` binds parameters. Its confirmation shows the values that will be written, and the approved values run in the named database and schema. Each row is an array with one value per column, and a call carries at most 1,000 rows.
+`insert_rows` binds parameters. Its confirmation shows the values that will be written, and the approved values run in the named database and schema. Each row is an array with one value per column, and a call carries at most 1,000 rows. The [transaction rules](#execute_query) of `execute_query` apply: under Manual Commit the rows stay pending until the user commits them in TablePro. The reply has no `status_message` to say so.
`confirm_destructive_operation` runs one destructive statement, or a SQL Server script containing a destructive statement. This includes `DROP`, `TRUNCATE`, `ALTER … DROP`, and `DELETE` without `WHERE`. Other statements are rejected; use `execute_query` for those. The user approves it first, through your elicitation prompt if your client supports elicitation, otherwise through TablePro's own dialog on their Mac.
`transaction_control` takes `action` as `begin`, `commit` or `rollback`. The transaction stays open across calls until it is committed or rolled back, and it runs on the same session as the user's own tabs, so their editor runs and their grid saves land inside it while it is open. TablePro shows it above the connection's tabs and on its connections strip entry, with **Roll Back** and **Commit**, until it ends. Leave nothing open.
+`begin` is refused while a transaction is already open on the session, or while the session cannot say whether one is: commit or roll that one back first. On a connection with [Manual Commit](/features/sql-editor#manual-commit) on, all three actions are refused, because the user commits there.
+
On Redis the three actions are `MULTI`, `EXEC` and `DISCARD`. Every command between `begin` and `commit` answers `QUEUED` and does nothing until `commit` runs them, and `commit` fails naming each command the server then refused. `rollback` drops the block whole.
## Databases and objects
diff --git a/development/plugin-development.mdx b/development/plugin-development.mdx
index a0dd151..81101c8 100644
--- a/development/plugin-development.mdx
+++ b/development/plugin-development.mdx
@@ -13,7 +13,7 @@ A plugin is a macOS loadable bundle target with `WRAPPER_EXTENSION = tableplugin
| Key | Type | Required | Purpose |
|-----|------|----------|---------|
-| `TableProPluginKitVersion` | integer | Yes | The PluginKit ABI the plugin was built against. Current value: 43 |
+| `TableProPluginKitVersion` | integer | Yes | The PluginKit ABI the plugin was built against. Current value: 44 |
| `TableProProvidesDatabaseTypeIds` | array of strings | Recommended | Database type IDs the plugin serves, which is what makes lazy loading possible |
| `CFBundleShortVersionString` | string | Yes | Plugin version shown in **Settings > Extensions** |
| `CFBundleVersion` | string | Yes | Build number. Of two copies of a plugin the higher build loads, and a registry update needs a higher build |
diff --git a/features/connection-window.mdx b/features/connection-window.mdx
index 3e78485..ed2e39e 100644
--- a/features/connection-window.mdx
+++ b/features/connection-window.mdx
@@ -185,7 +185,9 @@ Quit, **Relaunch to Update**, closing a window, a connection or a tab, and Disco
- an agent reply, including one waiting for your answer
- a comparison or a sync script in Compare & Sync
-**Quit Anyway**, **Relaunch Anyway**, **Close Anyway** or **Disconnect Anyway** stops each item on the list. **Cancel**, or Escape, keeps everything running. Quitting lists unsaved tabs on the same alert, and closing or disconnecting lists an open transaction there. When you close a window or a connection, unsaved edits still get **Do you want to save changes?** after it.
+**Quit Anyway**, **Relaunch Anyway**, **Close Anyway** or **Disconnect Anyway** stops each item on the list. **Cancel**, or Escape, keeps everything running. Quitting lists unsaved tabs and open transactions on the same alert, and closing or disconnecting lists an open transaction there. When you close a window or a connection, unsaved edits still get **Do you want to save changes?** after it.
+
+With nothing running, a quit or a relaunch still asks while a transaction is open: **Quit with an Open Transaction?** names each connection whose uncommitted changes the server rolls back, and adds unsaved tabs when there are any.
A stopped restore can leave the database partly restored, and a stopped sync script keeps the statements it already ran.
diff --git a/features/data-grid.mdx b/features/data-grid.mdx
index 47d73f6..fbe8722 100644
--- a/features/data-grid.mdx
+++ b/features/data-grid.mdx
@@ -3,9 +3,9 @@ title: Data Grid
description: Sort, size, hide, highlight, chart, map and copy the rows a table or a query puts in the grid
---
-Most of the grid's controls sit in the status bar beneath it. The view switcher is at the leading edge, followed by the row count and, while cells are selected, their [sum](#selection-summary). The columns, highlight, filter and page buttons sit at the trailing edge.
+Most of the grid's controls sit in the status bar beneath it. The view switcher is at the leading edge, followed by the row count and, while cells are selected, their [sum](#selection-summary). The columns, highlight, [auto refresh](#auto-refresh), filter and page buttons sit at the trailing edge.
-A narrow window trims that bar rather than cutting it off. The Columns and Filters buttons drop their titles first, and **First** and **Last** leave with them; the Query menu still carries all four page commands. Narrower still, the view switcher becomes a pull-down naming the current mode and rows-per-page moves into the page indicator's menu. Everything else keeps its place.
+A narrow window trims that bar rather than cutting it off. The Columns, Auto Refresh and Filters buttons drop their titles first, and **First** and **Last** leave with them; the Query menu still carries all four page commands. Narrower still, the view switcher becomes a pull-down naming the current mode and rows-per-page moves into the page indicator's menu. Everything else keeps its place.
@@ -174,6 +174,24 @@ On a table tab, sorting, filtering, and changing page or page size start at the
Saving edits, importing rows, **Insert Document…**, a structure change and **Refresh Materialized View…** reload every tab showing the table they changed, in every window of the connection. The tab in front reloads at once and keeps its place. A tab behind it reloads when you switch to it. A tab with a cell open or unsaved edits is not interrupted. It reloads as soon as the cell is closed and its edits are saved, undone or discarded. Tabs on other tables stay as they are. A SQL file import reaches every table tab of the connection the same way. A statement run from the SQL editor reloads nothing, so press `Cmd+R` on the tabs it touched.
+### Auto Refresh
+
+To watch a table change, click the clock button in the status bar, or open **Database > Auto Refresh**, and pick **Every 5 Seconds**, **Every 10 Seconds**, **Every 30 Seconds**, **Every Minute** or **Every 5 Minutes**. **Off** stops it. Each refresh reads the rows the way `Cmd+R` does and keeps your place, but leaves the row count as it was and adds nothing to [query history](/features/query-history). `Cmd+R` recounts and starts the wait over.
+
+Each table tab keeps its own interval, and only the tab in front refreshes. The interval is not saved: opening another table in the tab, closing the tab or quitting turns it off. Query tabs have no Auto Refresh, and the button shows only in **Data** view.
+
+A refresh never asks or interrupts. It waits for the next interval while:
+
+- the table has unsaved changes, or a cell is being edited
+- rows are loading
+- the connection is down
+- a transaction is open on the tab's database
+- rows are selected in a table without a primary key
+- the tab is not the one in front, or its window is not on screen
+- the tab is in another view mode, you are scrolling or dragging a selection, or a value viewer or value filter is open
+
+For the first five, the clock button's tooltip names the reason. Another app in front does not stop it while the window stays on screen. A refresh that fails turns Auto Refresh off and leaves the error in the tab.
+
## Copying
Click a cell to select its row and put the cell cursor on that cell. Drag or `Shift`-click for a range of cells, and `Cmd`-click to add or remove a cell. Click a row number to select a whole row; drag down the row numbers, or `Shift`-click or `Cmd`-click them, for several. `Cmd+A` selects every row and leaves no cell cursor. `Escape` shrinks a range of cells to the cursor's row, and a second `Escape` clears the selection.
diff --git a/features/er-diagram.mdx b/features/er-diagram.mdx
index 92dce8a..06a0fca 100644
--- a/features/er-diagram.mdx
+++ b/features/er-diagram.mdx
@@ -69,7 +69,11 @@ Right-click a table, a column, a relationship or the empty canvas for what appli
| Relationship | **Show Structure of** the table that holds the key, **Delete Foreign Key** |
| Empty canvas | **New Table…**, **Refresh** |
-To add a foreign key, hover over the column that will hold it, drag from the dot on the table's right edge, and drop on the column it references. A sheet confirms the columns, the constraint name and the `ON DELETE` and `ON UPDATE` actions. **Add Foreign Key…** in a column's menu opens the same sheet without the drag.
+To add a foreign key, hover over the column that will hold it, drag from the dot on the table's right edge, and drop on the column it references. A sheet confirms the column pairs, the constraint name and the `ON DELETE` and `ON UPDATE` actions. **Add Foreign Key…** in a column's menu opens the same sheet without the drag.
+
+Each row of the sheet's list pairs a **Column** of this table with a **Referenced Column**, and the rows are the key's order on both sides. The sheet fills in the referenced table's whole primary key, one row per key column, so a key on `(order_id, line_no)` arrives as two rows. Your column takes the key column you dropped on, or the one the sheet picks when you came from the menu, and each other key column gets a column of this table with the same name, or **None** where there is none. A drop on a column outside the primary key gives that one pair, and a referenced table without a primary key starts on its first column. Choosing another referenced table fills the rows again from its key.
+
+Click **+** under the list to add a pair and **−** or `Delete` to remove the selected ones; the last pair stays. Drag a row to reorder the pairs, or use **Move Up** and **Move Down** in VoiceOver. **Add Foreign Key** stays dimmed until every row names both columns and no column repeats, and the line under the list names the problem.
To drop a foreign key, click its relationship line and press `Delete`.
diff --git a/features/keyboard-shortcuts.mdx b/features/keyboard-shortcuts.mdx
index ee628ed..6ca3b45 100644
--- a/features/keyboard-shortcuts.mdx
+++ b/features/keyboard-shortcuts.mdx
@@ -214,6 +214,8 @@ See [Filtering](/features/filtering) for the filter bar itself.
| Move tab to connection | `Ctrl+Option+Cmd+C` |
| [Server Dashboard](/features/server-dashboard) | `Cmd+Option+Shift+D` |
| [Query Insights](/features/query-insights) | `Cmd+Option+Shift+I` |
+| [Commit transaction](/features/sql-editor#the-open-transaction-bar) | none by default, rebindable |
+| [Roll back transaction](/features/sql-editor#the-open-transaction-bar) | none by default, rebindable |
| Open database switcher | `Cmd+K` |
| New database (database switcher open) | `Cmd+N` |
| Refresh | `Cmd+R` |
diff --git a/features/query-history.mdx b/features/query-history.mdx
index f1c7680..999d238 100644
--- a/features/query-history.mdx
+++ b/features/query-history.mdx
@@ -76,13 +76,13 @@ An entry belonging to another connection loads into a new tab in that connection
## Pausing
-The pause button stops recording on this Mac, from every source: row edits, structure changes, imports and AI clients included. The drawer says so until you resume. Pausing is local to the Mac you press it on and survives relaunch.
+The pause button stops recording on this Mac, from every source: row edits, structure changes, imports and AI clients included. Query tabs keep no [earlier versions](/features/sql-editor#earlier-versions) while it is paused. The drawer says so until you resume. Pausing is local to the Mac you press it on and survives relaunch.
## Clearing history
The trash button deletes exactly the entries the drawer is listing. Anything the source, date, outcome or search filters are hiding stays, which at the default **My Queries** source spares table browsing, row edits, imports and AI queries. The confirmation names what it is about to delete. There is no undo.
-**Settings > Data > Query History > Clear History…** clears everything, for every connection.
+**Settings > Data > Query History > Clear History…** clears everything, for every connection, query tabs' earlier versions included.
## Storage and retention
diff --git a/features/routines-triggers.mdx b/features/routines-triggers.mdx
index b16d716..e7f25fa 100644
--- a/features/routines-triggers.mdx
+++ b/features/routines-triggers.mdx
@@ -1,6 +1,6 @@
---
title: Procedures, Functions, and Triggers
-description: Browse stored procedures, functions, and triggers per schema and read their source
+description: Browse stored procedures, functions, triggers, MySQL events and PostgreSQL extensions, and read their source
---
Expand a schema and **Procedures**, **Functions**, and **Triggers** sit beside **Tables**. Select one, press Return, and its source opens in a read-only tab. Named types have a section of their own; see [User-Defined Types](/features/user-defined-types).
@@ -31,6 +31,19 @@ Expand a schema and **Procedures**, **Functions**, and **Triggers** sit beside *
A section appears only when the schema holds at least one object of that kind, so a database with no tables still lists its procedures and functions, and one with no triggers shows no Triggers section. A schema that holds nothing shows **No items**, or **Loading…** while its lists are on their way. A list the server refused keeps its section and shows the error in place of its rows.
+## Events and extensions
+
+The engines in this table list one more kind of object in each database:
+
+| Engine | Section | Where it sits in **View > Sidebar as Tree** | Server version | Beside the name |
+|---|---|---|---|---|
+| MySQL, MariaDB | **Events** | After **Triggers** | 5.1.6 and later | **Recurring** or **One Time** |
+| PostgreSQL, PGlite | **Extensions** | After the database's schemas | 9.1 and later | The installed version |
+
+With **View > Sidebar as List** both are sections after the others. The same rules apply as to the rest: a section shows only when it has a row, and a list the server refused shows its error. Point at a row for an event's schedule, status and definer, or an extension's version, schema and owner.
+
+Both are read-only here. Return, a double-click or **Show DDL** opens the definition in the same viewer as a routine's source, and **Copy Name** is on the menu. An event opens as the server's `CREATE EVENT`, an extension as `CREATE EXTENSION IF NOT EXISTS … WITH SCHEMA …` with its comment. To enable, disable, create or drop one, run `ALTER EVENT`, `CREATE EXTENSION` or `DROP …` in a query tab.
+
## Finding a routine or trigger
A trigger row carries the table it fires for beside its name. The sidebar filter matches a trigger by its own name or by that table; type-select matches the name only. Triggers also appear on their table's **Structure** tab.
diff --git a/features/sql-editor.mdx b/features/sql-editor.mdx
index 7517ff3..cd7c4e2 100644
--- a/features/sql-editor.mdx
+++ b/features/sql-editor.mdx
@@ -44,24 +44,17 @@ A SQL Server script runs a batch at a time instead, cut at its `GO` lines, so a
| The batch | Runs in | A failure or Stop |
|---|---|---|
| Ordinary statements | A transaction TablePro opens and commits | Everything rolls back |
+| Ordinary statements, with [Manual Commit](#manual-commit) on | A transaction TablePro opens and leaves open for you to commit | Everything rolls back |
| One that manages its own: `BEGIN`, `START TRANSACTION`, `XA START`, `SET autocommit`, `SAVEPOINT` on SQLite, `SET TRANSACTION` on Oracle | The script's own transaction | The transaction it left open is rolled back |
| One holding a [statement a transaction cannot hold](#statements-a-transaction-cannot-hold) | No transaction | Each statement that ran stays applied, and the banner counts them |
| A script on SQL Server | No transaction, unless the script opens one with `BEGIN TRAN` | What ran stays applied, and a transaction the script left open is reported |
| Anything, on a connection that already has a transaction open | That transaction | The transaction stays open and the message says so |
-The last row wins over the rest. The open transaction comes from a `BEGIN` you ran with `Cmd+Enter`, a `SET autocommit = 0`, `LOCK TABLES` on MySQL or MariaDB, a `SET TRANSACTION`, `SAVEPOINT` or `LOCK TABLE` on Oracle, or an [MCP client's](/developers/mcp-tools) `begin`, and a batch that joins it sends no `BEGIN`, `COMMIT` or `ROLLBACK` at all: the script's own text decides, so a script ending in `COMMIT` commits. Where a failed statement has left the transaction unable to commit, the message says to roll it back rather than offering the choice. A `BEGIN` left running here reaches the rest of the window too, so a grid save and a **Users & Roles** apply land inside it.
+The last row wins over the rest. The open transaction comes from a `BEGIN` you ran with `Cmd+Enter`, a write under Manual Commit, a `SET autocommit = 0`, `LOCK TABLES` on MySQL or MariaDB, a `SET TRANSACTION`, `SAVEPOINT` or `LOCK TABLE` on Oracle, or an [MCP client's](/developers/mcp-tools) `begin`, and a batch that joins it sends no `BEGIN`, `COMMIT` or `ROLLBACK` at all: the script's own text decides, so a script ending in `COMMIT` commits. Where a failed statement has left the transaction unable to commit, the message says to roll it back rather than offering the choice. A `BEGIN` left running here reaches the rest of the window too, so a grid save and a **Users & Roles** apply land inside it.
PostgreSQL, Redshift, CockroachDB, MySQL, MariaDB, TiDB, SQLite, DuckDB, SQL Server and Oracle report what their session holds. Anywhere else there is no answer to be had, so a plain batch is wrapped as it always was and a self-managed script is left alone after a failure, since the transaction its text opened may well predate the run.
-Two things survive a rollback in any of those four cases. MySQL, MariaDB and Oracle commit a `CREATE`, `ALTER` or `DROP` the moment it runs, along with everything before it, and CockroachDB commits the open transaction before it processes any DDL at all.
-
-### The open transaction bar
-
-While a session holds a transaction, a bar above every tab of the connection says **Transaction Open**, names the database, and offers **Roll Back** and **Commit**. It shows whoever opened the transaction, a `BEGIN` you ran, a grid save inside one, or an [MCP client's](/developers/mcp-tools) `transaction_control`, and goes once it ends, by its buttons, by a typed `COMMIT` or `ROLLBACK`, or with the session. On PostgreSQL, Redshift and CockroachDB each database keeps its own connection, so two databases with open transactions show a row each. The [connections strip](/features/workspace-rail) marks the entry with an hourglass, so you see it from another connection.
-
-**Transaction Failed** means a statement inside it failed and it can no longer commit, so only **Roll Back** is offered. **Roll Back** asks first at every [Safe Mode](/features/safe-mode) level. **Commit** asks what a typed `COMMIT` asks: nothing at **Silent**, a confirmation at the Alert levels, a confirmation and Touch ID at the Safe Mode levels. At **Read-Only** it is hidden.
-
-Both act on the connection the bar names. When other work ran there after you clicked, they do nothing and say so: check the transaction and try again.
+Two things survive a rollback in any of those cases. MySQL, MariaDB and Oracle commit a `CREATE`, `ALTER` or `DROP` the moment it runs, along with everything before it, and CockroachDB commits the open transaction before it processes any DDL at all.
### Statements a transaction cannot hold
@@ -93,6 +86,43 @@ If the connection dies while the commit is in flight, the result says the statem
Stop and `Cmd+.` act on the tab you are looking at. A query started in another tab, or on the same connection in another window, waits for the running one rather than stopping it: the waiting tab shows the ordinary **Executing…** spinner and a live Stop for as long as the other one runs, and a table opened in a new tab shows an empty grid with a spinner. Stopping the waiting tab leaves the running batch alone.
+## Transactions
+
+### The open transaction bar
+
+While a session holds a transaction, a bar above every tab of the connection says **Transaction Open**, names the database, and offers **Roll Back** and **Commit**. It shows whoever opened the transaction: a `BEGIN` you ran, a write under [Manual Commit](#manual-commit), a grid save inside one, or an [MCP client's](/developers/mcp-tools) `transaction_control`. It goes once the transaction ends, by its buttons, by a typed `COMMIT` or `ROLLBACK`, or with the session. On PostgreSQL, Redshift and CockroachDB each database keeps its own connection, so two databases with open transactions show a row each. The [connections strip](/features/workspace-rail) marks the entry with an hourglass, so you see it from another connection.
+
+**Database > Commit Transaction** and **Database > Roll Back Transaction** do what the buttons do, for the database of the tab in front. Neither has a shortcut until you record one in **Settings > Keyboard**.
+
+**Transaction Failed** means a statement inside it failed and it can no longer commit, so only **Roll Back** is offered. On PostgreSQL any failed statement does this, reads included: a typo in a filter leaves nothing to commit. **Roll Back** asks first at every [Safe Mode](/features/safe-mode) level. **Commit** asks what a typed `COMMIT` asks: nothing at **Silent**, a confirmation at the Alert levels, a confirmation and Touch ID at the Safe Mode levels. At **Read-Only** it is hidden, and **Commit Transaction** is dimmed.
+
+Commit and Roll Back act on the connection the bar names. When other work ran there after you clicked, they do nothing and say so: check the transaction and try again.
+
+The server rolls back what a session leaves open, so quitting or relaunching to update asks first while a transaction is open. See [Work still running](/features/connection-window#work-still-running).
+
+### Manual Commit
+
+With **Manual Commit** on, nothing you change is saved until you commit it. A new connection starts with it off. Turn it on under **Access** on the [connection form's](/connections/connection-form#options) **Options** tab, or choose **Database > Manual Commit** while connected: both change the one setting saved with the connection.
+
+MySQL, MariaDB, TiDB, OceanBase, Oracle, ClickHouse, Redshift and CockroachDB commit schema and maintenance statements on their own, so Manual Commit is not offered there. The toggle and the menu item are dimmed, with "This database commits schema and maintenance statements on its own, so changes can't wait for Commit." under them, and a connection saved with Manual Commit on runs as if it were off.
+
+The first write opens a transaction and the bar appears. Writes after it join that transaction until you commit or roll back, and reads open nothing. That covers statements you run in a query tab, grid saves, [Data Rewind](/features/change-tracking#restoring-a-save) restores, imports, and what an MCP client writes through [`execute_query`](/developers/mcp-tools#execute_query) or `insert_rows`. Structure changes, **Users & Roles**, **Copy To…**, [Generate Rows](/features/table-operations#generate-test-rows) and [Shortcuts](/integrations/shortcuts) actions still save at once. A statement that manages its own transaction, such as `BEGIN` or `SET autocommit`, runs as typed, and so does a [statement a transaction cannot hold](#statements-a-transaction-cannot-hold) on its own.
+
+If that first write fails, the transaction it opened is rolled back. Turning Manual Commit off leaves an open transaction open, bar and all, until you commit or roll it back.
+
+A change Manual Commit cannot hold is refused before anything runs, with a message that says how to run it:
+
+- a write on a connection with no transactions, one that cannot report whether a transaction is open, or one holding locks with no transaction open
+- a run that mixes a change with a statement a transaction cannot hold, such as `VACUUM`
+- a save that sets session options around its statements, as putting back rows with their identity values does on SQL Server
+- an import that turns off foreign key checks, as **Disable foreign key checks** does by default, or runs with **Wrap in transaction** off or **On error** set to **Skip and Continue**
+
+Of the other engines, the ones that report what their session holds are named under [Which transaction the batch runs in](#which-transaction-the-batch-runs-in). Once a connection has shown it cannot report, **Database > Manual Commit** is dimmed while it is off, with "This database can't report an open transaction, so it commits each change." under it. While it is on, the item stays available to turn it off.
+
+### Schema changes while a transaction is open
+
+A Structure save, a new table and a trigger change each run on a connection of their own. While a transaction is open on the connection, whether Manual Commit or a `BEGIN` you typed opened it, they ask **A Transaction Is Open** first: the change can wait on that transaction's locks until you commit or roll back. **Continue** runs it, and **Cancel** runs nothing.
+
## Statement markers
The editor marks which statement it is about to send.
@@ -186,6 +216,22 @@ Replace moves on to the next match. All replaces every match in one step, and on
The editor also carries multiple cursors, for editing several places at once.
+## Earlier versions
+
+A query tab keeps earlier versions of its text on this Mac. **File > Revert To** lists the last ten, each named by its time and, where one applies, what kept it: Run, Before Replace or Before Restore. Choose one to put it back in the tab. **Browse All Versions…** at the foot of that menu opens a History tab, the same view [saved queries](/features/favorites#saved-query-versions) use: **Changes** compares a version with the tab's current text, and **Restore This Version** puts it back. A restore from either place first keeps the text it replaces, as a Before Restore version.
+
+A version is kept:
+
+- when the query runs
+- after a pause in typing. Pauses within 5 minutes of the first one fold into one version, so steady typing leaves about one every 5 minutes
+- before **Clear Query**, before a query loads into the tab from [Query History](/features/query-history) or Open Quickly, before **Apply to Editor** from the [AI assistant](/features/ai-assistant), and before a saved query is inserted
+
+Each tab keeps up to 50 versions, for 30 days or for Query History's **Keep entries for** when that is shorter. Blank text and a copy of the newest version are skipped, and nothing is kept while [Query History is paused](/features/query-history#pausing). Table tabs keep none.
+
+Versions stay when a tab closes, and **File > Reopen Closed Tab** brings them back with it. Deleting the connection, or **Clear History…** in [Settings > Data](/customization/data-settings#query-history), removes them. They never sync.
+
+While the tab is on screen, `Cmd+Z` undoes **Clear Query**, a loaded query, **Apply to Editor** and an inserted saved query.
+
## Formatting
Press `Cmd+Shift+L` to format the statement at the cursor. The toolbar's format button and **Query > Format Query** do the same, and the shortcut is rebindable in **Settings > Keyboard**.
diff --git a/features/table-structure.mdx b/features/table-structure.mdx
index fe58e89..cdbbd51 100644
--- a/features/table-structure.mdx
+++ b/features/table-structure.mdx
@@ -284,7 +284,7 @@ The queue outlives everything short of an explicit discard: closing the tab, clo
-A save runs on a connection of its own, so it never joins a transaction you have left open in a query tab.
+A save runs on a connection of its own, so it never joins a transaction you have left open in a query tab. While one is open, the save asks **A Transaction Is Open** first; see [Schema changes while a transaction is open](/features/sql-editor#schema-changes-while-a-transaction-is-open). DuckDB and PGlite have one connection, so there the save joins the open transaction and is committed or rolled back with it.
Once a save has run, even partway, every tab on the table loads its rows again, in any window: the tab on screen at once, its Data view included while Structure is in front, and the rest when you next switch to them. A tab holding unsaved row edits keeps its rows, and asks first if it is the one on screen in Data. Tabs on other tables are left alone.
diff --git a/features/tabs.mdx b/features/tabs.mdx
index c46fb64..9379fc4 100644
--- a/features/tabs.mdx
+++ b/features/tabs.mdx
@@ -73,7 +73,7 @@ A dot on the tab marks unsaved text or unsaved edits. It is deliberately wider t
## Reopening closed tabs
-`Cmd+Shift+T`, or **File > Reopen Closed Tab**, brings back the last query or table tab you closed, with its SQL, cursor position, and database context. The last 20 are kept for 30 days, and deleting a connection deletes its closed tabs with it. Server Dashboard, Users & Roles, and structure tabs are not candidates.
+`Cmd+Shift+T`, or **File > Reopen Closed Tab**, brings back the last query or table tab you closed, with its SQL, cursor position, database context, and a query tab's [earlier versions](/features/sql-editor#earlier-versions). The last 20 are kept for 30 days, and deleting a connection deletes its closed tabs with it. Server Dashboard, Users & Roles, and structure tabs are not candidates.
Pending cell edits are the one thing that does not come back: they are never written to disk, so **Don't Save** on the close prompt is final.