diff --git a/customization/data-settings.mdx b/customization/data-settings.mdx index 73bb759..af3c78b 100644 --- a/customization/data-settings.mdx +++ b/customization/data-settings.mdx @@ -1,6 +1,6 @@ --- title: Data Settings -description: Data grid font, pagination, query result cap, JSON viewer, and query history +description: Data grid font, copy format, pagination, query result cap, JSON viewer, and query history --- Browsing a table pages 1,000 rows at a time, and a query that returns more than 10,000 rows stops there. Both numbers, and the rest of what the grid does before you touch anything, are on **Settings > Data**. @@ -34,6 +34,14 @@ The picker lists the monospaced families installed on your Mac, at 10 to 24 pt. | Default row sort | No sorting (engine order) | Or Primary key, First column. Applied when a table first opens; clicking a column header overrides it | | Sort direction | Ascending | Or Descending. Sets the default row sort's direction and which way the first click on a column header sorts | +## Copying + +| Setting | Default | Options | +|---------|---------|---------| +| Copy rows as | TSV | TSV, TSV with Headers, JSON, CSV, CSV with Headers, Markdown | + +`Cmd+C` writes this format for whole rows, picked by their row numbers or with `Cmd+A`, in any grid that shows rows of data; the Structure tab keeps copying its columns and indexes. A cell range copies as tab-separated cells, and a clicked cell as its value. Every format, IN Clause and the statements included, is also under **Edit > Copy Special** and the grid's **Copy as** menu; see [Copying](/features/data-grid#copying). + ## Pagination | Setting | Default | Options | diff --git a/features/data-grid.mdx b/features/data-grid.mdx index 43fcb80..cf57423 100644 --- a/features/data-grid.mdx +++ b/features/data-grid.mdx @@ -158,12 +158,14 @@ Click a cell to select it, drag or `Shift`-click for a range, and `Cmd`-click to | Shortcut | Copies | |---|---| -| `Cmd+C` | The focused cell, or the selected rows as TSV | +| `Cmd+C` | A cell range as cells, a clicked cell as its value, selected rows in the **Copy rows as** format | | `Cmd+Shift+C` | The selected rows as TSV | | `Cmd+Option+C` | The same, with a header row | | `Cmd+Option+J` | The selected rows as JSON | -Right-click and open **Copy as** for CSV, CSV with Headers, Markdown, and **IN Clause**, which writes `('a', 'b', 'c')` for a `WHERE col IN (…)`. **INSERT Statement(s)** and **UPDATE Statement(s)** appear when the result comes from a single table whose structure has loaded, and never on MongoDB or Redis. UPDATE is also missing on a table without a primary key that has a column no match can compare, such as a SQL Server `sql_variant`. **Copy Column Values** on the header menu copies one column, one value per line. +**Copy rows as** in [Settings > Data](/customization/data-settings#copying) sets what `Cmd+C` writes for whole rows, picked by their row numbers or with `Cmd+A`: TSV, TSV with Headers, JSON, CSV, CSV with Headers or Markdown. Whatever the format, `Cmd+V` in a table pastes the copied rows, not the text. To copy one value out of a selection, choose **Edit > Copy Special > Copy Cell Value** for the cell the cursor is on, or **Copy Cell Value** in the right-click menu for the cell under the pointer. + +Right-click and open **Copy as** for CSV, CSV with Headers, Markdown, and **IN Clause**, which writes `('a', 'b', 'c')` for a `WHERE col IN (…)`. **INSERT Statement(s)** and **UPDATE Statement(s)** appear when the result comes from a single table whose structure has loaded, and never on MongoDB or Redis. UPDATE is also missing on a table without a primary key that has a column no match can compare, such as a SQL Server `sql_variant`. **Copy Column Values** on the header menu copies one column, one value per line. Every format is also in **Edit > Copy Special**, where IN Clause takes the one column a cell selection covers, or the cursor's column. Those items have no shortcut until you record one in **Settings > Keyboard**. Every copy follows the grid as shown: hidden columns are left out, columns keep their current order, and over a cell selection only those columns go out. INSERT and UPDATE write what a save of the same row would. They leave out the columns the server fills in, such as identity and computed columns. INSERT leaves a cell set to `DEFAULT` to the server, and UPDATE assigns it `DEFAULT`. The table name carries its schema. UPDATE finds the row as it is stored, not as you have edited it: by every column of the primary key, whether or not those cells are selected, or on a table without one by every column, hidden ones included, which also changes any identical copy of the row. A row you added and have not saved gets no UPDATE. diff --git a/features/keyboard-shortcuts.mdx b/features/keyboard-shortcuts.mdx index 836100f..3a597df 100644 --- a/features/keyboard-shortcuts.mdx +++ b/features/keyboard-shortcuts.mdx @@ -138,9 +138,11 @@ Truncate table opens a dialog with **Cascade** and **Ignore foreign key checks** | Copy rows as TSV | `Cmd+Shift+C` | | Copy with headers | `Cmd+Option+C` | | Copy as JSON | `Cmd+Option+J` | +| Copy Cell Value | none by default, rebindable | +| Copy as CSV, CSV with Headers, Markdown, IN Clause, INSERT Statements, UPDATE Statements | none by default, rebindable | | Paste | `Cmd+V` | -`Cmd+C` copies a drag-selected range as TSV, a single focused cell as its value, and otherwise the selected rows as TSV. +`Cmd+C` copies a drag-selected range as TSV, a clicked cell as its value, and otherwise the selected rows in the format **Copy rows as** sets in [Settings > Data](/customization/data-settings#copying). ### Pagination