diff --git a/customization/notifications.mdx b/customization/notifications.mdx index a0834c2f..0dd0eb68 100644 --- a/customization/notifications.mdx +++ b/customization/notifications.mdx @@ -1,6 +1,6 @@ --- title: Notifications -description: Which finished operations notify you, how long work has to run first, and what the notification carries +description: When finished work notifies you, how long it has to run first, and what the notification carries --- You only get told when the result is somewhere you are not. That means TablePro behind another window or in another Space, the window minimized, or the tab that ran the work not the one on screen. Work you cancelled yourself never notifies, and neither does anything that finished faster than the threshold. @@ -14,19 +14,10 @@ You only get told when the result is somewhere you are not. That means TablePro | Setting | Default | Covers | | --- | --- | --- | -| **Notify when long-running work finishes** | On | The master switch for every kind in this table | +| **Notify when long-running work finishes** | On | Every kind of work below | | **Only after** | 20 seconds | How long work has to run to count: 5, 10, 20 or 30 seconds, or 1, 2, 5 or 10 minutes | -| **Queries** | On | Editor queries, including Explain | -| **Statement batches** | On | Execute All Statements, as one notification for the batch | -| **Row edits** | On | Saving edited rows | -| **Structure changes** | On | Applying table structure changes | -| **Imports** | On | File imports | -| **Exports** | On | Exports, including streaming exports | -| **Object copies** | On | Copy To and Duplicate Database | -| **Backups** | On | Database dumps | -| **Fetch all rows** | On | Loading every row of a truncated result | -| **AI and MCP queries** | On | Queries an AI assistant or MCP client runs | -| **AppleScript queries** | On | Queries [a script](/developers/applescript) runs | + +The kinds that count: editor queries including Explain, Execute All Statements as one notification for the batch, saving edited rows, structure changes, imports, exports, Copy To and Duplicate Database, database dumps, fetching every row of a truncated result, and queries an AI assistant, an MCP client or [a script](/developers/applescript) runs. Keep **Only after** below the [query timeout](/customization/general-settings#query-timeout), or a query that times out finishes before its notification is due. diff --git a/customization/settings.mdx b/customization/settings.mdx index d0c4a653..f4c967c9 100644 --- a/customization/settings.mdx +++ b/customization/settings.mdx @@ -83,7 +83,6 @@ What a fresh install ships with, so one glance down this column says what you ch | Data | Keep saved changes for restoring | On | | Notifications | Notify when long-running work finishes | On | | Notifications | Only after | 20 seconds | -| Notifications | Every operation kind | On | | AI | Enable AI Features | On | | AI | Enable inline suggestions while typing | Off | | AI | Debounce | 500 ms | diff --git a/databases/postgresql.mdx b/databases/postgresql.mdx index 3dc5a9d2..b1b5525c 100644 --- a/databases/postgresql.mdx +++ b/databases/postgresql.mdx @@ -24,7 +24,7 @@ Any server from 9.1 on works. A feature the server predates stays out of the sid |---|---| | Materialized views | 9.3 | | BRIN indexes, the **Bypass row level security** role attribute | 9.5 | -| Declarative partitioning, identity columns, renaming an enum label | 10 | +| Declarative partitioning, identity columns | 10 | | Generated columns | 12 | @@ -104,7 +104,7 @@ A value the list cannot represent opens the text editor instead: a multi-dimensi ## User-defined types -Enums, composites, domains and ranges are listed under **Types** in each schema, the `CREATE` statement rebuilt from `pg_type`. An enum's labels are edited in place with `ALTER TYPE … ADD VALUE` and, from PostgreSQL 10, `RENAME VALUE`; PostgreSQL has no statement that drops or reorders a label. The structure editor's type picker offers the schema's types under **User-Defined**. See [User-Defined Types](/features/user-defined-types). +Enums, composites, domains and ranges are listed under **Types** in each schema, the `CREATE` statement rebuilt from `pg_type`. The structure editor's type picker offers the schema's types under **User-Defined**. See [User-Defined Types](/features/user-defined-types). ## Views and comments diff --git a/developers/mcp-tools.mdx b/developers/mcp-tools.mdx index f5a04b4d..da7c5685 100644 --- a/developers/mcp-tools.mdx +++ b/developers/mcp-tools.mdx @@ -211,7 +211,7 @@ On Redis the three actions are `MULTI`, `EXEC` and `DISCARD`. Every command betw | `list_grants` | `connection_id`, `principal` (`host`) | `principal`, `grants[]` (`privilege`, `scope`, `is_grantable`). `scope` is a dotted path, `*` for a server-wide grant | | `list_session_contexts` | `connection_id` | `is_supported`, `contexts[]` (`id`, `label`, `value`, `options[]`) | -`get_server_dashboard` reads the live panels TablePro shows, and runs on PostgreSQL, MySQL, SQL Server, ClickHouse, DuckDB and SQLite. Name the panels in `panels[]` or omit it for all three. A session carries `id` (the process id `stop_server_session` takes), `user`, `database`, `state`, `duration_seconds`, `query`, `can_kill` and `can_cancel`; a metric carries `id`, `label`, `value`, `unit`; a slow query carries `duration`, `query`, `user`, `database`. A panel the server could not answer is left out, and `errors` names it: one fixed sentence per panel, keyed by panel name. The server's own message is not sent to the client; it goes to the app's log, where the user can read it. When every requested panel fails, the call fails. +`get_server_dashboard` reads the live panels TablePro shows, and runs on PostgreSQL, MySQL, SQL Server, ClickHouse and Typesense. Name the panels in `panels[]` or omit it for all three. A session carries `id` (the process id `stop_server_session` takes), `user`, `database`, `state`, `duration_seconds`, `query`, `can_kill` and `can_cancel`; a metric carries `id`, `label`, `value`, `unit`; a slow query carries `duration`, `query`, `user`, `database`. A panel the server could not answer is left out, and `errors` names it: one fixed sentence per panel, keyed by panel name. The server's own message is not sent to the client; it goes to the app's log, where the user can read it. When every requested panel fails, the call fails. `stop_server_session` takes `mode` as `cancel` (default) to stop the running query or `kill` to end the session. SQL Server, ClickHouse and MySQL before 5.0 take only `kill`: their sessions report `can_cancel` false, and `cancel` fails with `invalid_argument`. The user always approves this one, whatever Safe Mode says. diff --git a/features/backup-restore.mdx b/features/backup-restore.mdx index c1eba84b..57a13bf8 100644 --- a/features/backup-restore.mdx +++ b/features/backup-restore.mdx @@ -110,21 +110,42 @@ MySQL's clients and MariaDB's no longer take the same flags. MySQL's take `--ssl MariaDB's clients have no flag for encrypting without verifying, so **Required** reaches them as `--ssl --ssl-verify-server-cert`. That refuses a server offering no TLS. With no CA certificate set it checks the encryption rather than the server's identity. -## Server-side export - -Oracle, Snowflake and BigQuery do not have a client-side dump. They unload to somewhere the server can write: a `DIRECTORY` object, a stage, a Cloud Storage bucket. Choose **File > Server-Side Export…** for those. - -Pick a table and name the destination. Oracle takes the name of a `DIRECTORY` object rather than a path, because the path belongs to the server. Snowflake takes a stage, with or without its `@`. BigQuery takes a `gs://` prefix and shards its output under it. - -The statement runs on your own connection, so it carries your privileges and the server's own error comes back when the destination is not writable. - -Snowflake and BigQuery block until the unload finishes, so the file exists by the time the sheet says so. **Stop** asks the server to cancel one and stops waiting either way. - -Oracle is different. The Data Pump block starts a job and detaches, so the statement returns before anything is written and the sheet says the job was started rather than finished. Watch `DBA_DATAPUMP_JOBS` for its progress, and stop it there. - - -Nothing lands on your Mac. The result is on the server or in the bucket, and the sheet says where it went. - +## Unloading on the server + +Oracle, Snowflake and BigQuery have no client-side dump. Unload to somewhere the server can write by running the engine's own statement in a query tab. It runs with your privileges, so the server's own error comes back when the destination is not writable. + + +```sql Oracle +DECLARE + h NUMBER; +BEGIN + h := DBMS_DATAPUMP.OPEN('EXPORT', 'TABLE'); + DBMS_DATAPUMP.ADD_FILE(h, 'orders.dmp', 'DP_DIR'); + DBMS_DATAPUMP.ADD_FILE(h, 'orders.log', 'DP_DIR', NULL, DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE); + DBMS_DATAPUMP.METADATA_FILTER(h, 'SCHEMA_EXPR', 'IN (''SALES'')'); + DBMS_DATAPUMP.METADATA_FILTER(h, 'NAME_EXPR', 'IN (''ORDERS'')'); + DBMS_DATAPUMP.START_JOB(h); + DBMS_DATAPUMP.DETACH(h); +END; +``` + +```sql Snowflake +COPY INTO @my_stage/orders +FROM sales.orders +FILE_FORMAT = (TYPE = CSV, COMPRESSION = GZIP, HEADER = TRUE) +OVERWRITE = FALSE; +``` + +```sql BigQuery +EXPORT DATA OPTIONS ( + uri = 'gs://my-bucket/orders-*.csv', + format = 'CSV', + overwrite = false +) AS SELECT * FROM sales.orders; +``` + + +In the Oracle block, `DP_DIR` is a `DIRECTORY` object, not a path. The block starts a Data Pump job and returns before the file is written: watch `DBA_DATAPUMP_JOBS` for its progress. BigQuery needs the `*` in the URI, because it shards its output. ## Passwords diff --git a/features/connection-window.mdx b/features/connection-window.mdx index 5072397b..1d76882d 100644 --- a/features/connection-window.mdx +++ b/features/connection-window.mdx @@ -69,7 +69,6 @@ The toolbar is still yours to arrange. Choose **View > Customize Toolbar**, or r | **Results** | The query editor's results pane (`Cmd+Option+R`) | | **Export** | Export Tables (`Cmd+Shift+E`) | | **Import** | The import format list (`Cmd+Shift+I`) | -| **Dashboard** | The [server dashboard](/features/server-dashboard) | | **History** | The [query history](/features/query-history) drawer (`Cmd+Y`) | A control you add yourself stays put. It stands in every context and dims when it has nothing to do, rather than leaving the way the default eight do. Your arrangement, and the **Show** setting in the same sheet, survive a relaunch. diff --git a/features/er-diagram.mdx b/features/er-diagram.mdx index 0c2bd24d..9b24e32a 100644 --- a/features/er-diagram.mdx +++ b/features/er-diagram.mdx @@ -70,7 +70,7 @@ A table whose primary key is made of two foreign keys, `user_roles` and its like **Export as PNG** renders the whole diagram at twice screen resolution with 40 points of padding, whatever the current zoom and scroll position, and saves it as `er-diagram.png`. `Cmd+C` puts the same image on the clipboard. Compact mode and expanded junction tables carry into the render, so set the view up first. -**Export as SQL** opens a query tab with `CREATE TABLE` and foreign key statements for the diagram's tables in the connection's dialect. SQLite inlines the foreign keys; other engines add them afterwards with `ALTER TABLE … ADD CONSTRAINT`, so the script survives circular references. +For the tables' DDL, choose **File > Export > Export Tables…**, pick SQL and leave **Structure** on. See [Import & Export](/features/import-export). ## Database support diff --git a/features/server-dashboard.mdx b/features/server-dashboard.mdx index 8abe4b81..c9743ac5 100644 --- a/features/server-dashboard.mdx +++ b/features/server-dashboard.mdx @@ -5,7 +5,7 @@ description: Monitor active sessions, server metrics, and slow queries in real t What this screen shows is what your account is allowed to see. A MySQL user without the `PROCESS` privilege gets only its own connections in the session list. A PostgreSQL role that is neither a superuser nor a member of `pg_monitor` gets everyone's backends with the Query column blank. An empty or half-blank dashboard is nearly always a privilege, not a fault. -Open it from **Database > Server Dashboard**, or from **Server Dashboard** under **Actions** in the toolbar. A **Dashboard** button is in the palette too, through [Customize Toolbar](/features/connection-window#add-a-control-back). +Open it from **Database > Server Dashboard**, or from **Server Dashboard** under **Actions** in the toolbar. - Sidebar tree with the Types section expanded under a PostgreSQL schema, and a tab showing an enum's labels with the rebuilt CREATE TYPE statement under them - Sidebar tree with the Types section expanded under a PostgreSQL schema, and a tab showing an enum's labels with the rebuilt CREATE TYPE statement under them + + Sidebar tree with the Types section expanded under a PostgreSQL schema, and a tab showing the rebuilt CREATE TYPE statement + Sidebar tree with the Types section expanded under a PostgreSQL schema, and a tab showing the rebuilt CREATE TYPE statement ## Engine support -| Engine | Types listed | Enum labels editable | -|---|---|---| -| PostgreSQL, PGlite | Enums, composites, domains, ranges | Yes | -| SQL Server | Alias types, table types, CLR types | No | -| Every other engine | None | No | +| Engine | Types listed | +|---|---| +| PostgreSQL, PGlite | Enums, composites, domains, ranges | +| SQL Server | Alias types, table types, CLR types | +| Every other engine | None | A table's own row type, the array type created beside every type, the multirange created beside every range, and any type an extension installed are left out. A type in another schema is listed under that schema. On SQL Server the built-in types are left out too, so the section holds only what the database declares. @@ -30,32 +30,9 @@ On SQL Server nothing is stored to read back at all, because a type has no `sys. A SQL Server table type is a table-valued parameter and cannot declare a column, so it is left out of the column type picker. Alias types appear there. -## Editing an enum's labels - -An enum's labels are listed above its definition in the order the server keeps them. Each edit runs as one `ALTER TYPE` statement the moment it is committed, on a connection of its own rather than inside a transaction open in a query tab; there is nothing to save afterwards, and the statement lands in the query history. - - - - Click **+** under the list to append one, or right-click a label and choose **Add Label Before…** or **Add Label After…** to place it. Type the label and press Return. Escape discards it. - - - Double-click a label, or right-click it and choose **Rename…**, edit it and press Return. - - - - -Renaming needs PostgreSQL 10 or later. On an older server the **Rename…** item is absent and a double-click does nothing. - - -Safe Mode applies as it does to any schema change. A connection set to read-only shows the labels without the controls, and Confirm Writes asks before the statement runs. - -### What cannot change - -PostgreSQL has no statement that removes a label or moves an existing one. To drop a label, create a new type without it, switch every column over, and drop the old type; **Open in Editor** puts the current definition in a query tab as the starting point. - -## Creating a type +## Changing or creating a type -Right-click the **Types** section and choose **New Type…**. A query tab opens with a `CREATE TYPE … AS ENUM` template addressed to that schema. Edit it, run it, then choose **Refresh** on the section. +The tab is read-only. **Open in Editor** puts the definition in a query tab; write the `ALTER TYPE` or `CREATE TYPE` there and run it, then choose **Refresh** on the **Types** section. On PostgreSQL, `ALTER TYPE … ADD VALUE` adds an enum label and, from PostgreSQL 10, `RENAME VALUE` renames one. No statement removes a label or moves an existing one. ## Using a type in a column diff --git a/images/user-defined-types-sidebar-dark.png b/images/user-defined-types-sidebar-dark.png index 0b6c0be2..1ba77bf2 100644 Binary files a/images/user-defined-types-sidebar-dark.png and b/images/user-defined-types-sidebar-dark.png differ diff --git a/images/user-defined-types-sidebar.png b/images/user-defined-types-sidebar.png index aa0a85b6..2b12d289 100644 Binary files a/images/user-defined-types-sidebar.png and b/images/user-defined-types-sidebar.png differ