diff --git a/docs.json b/docs.json index 220a85e..34d52a9 100644 --- a/docs.json +++ b/docs.json @@ -462,7 +462,8 @@ { "group": "TablePro for Windows", "pages": [ - "windows/data-grid" + "windows/data-grid", + "windows/browsing" ] } ] diff --git a/images/windows-definition-dark.png b/images/windows-definition-dark.png new file mode 100644 index 0000000..c5179a9 Binary files /dev/null and b/images/windows-definition-dark.png differ diff --git a/images/windows-definition.png b/images/windows-definition.png new file mode 100644 index 0000000..547f2c6 Binary files /dev/null and b/images/windows-definition.png differ diff --git a/images/windows-export-results-dark.png b/images/windows-export-results-dark.png new file mode 100644 index 0000000..a413761 Binary files /dev/null and b/images/windows-export-results-dark.png differ diff --git a/images/windows-export-results.png b/images/windows-export-results.png new file mode 100644 index 0000000..ec5833f Binary files /dev/null and b/images/windows-export-results.png differ diff --git a/images/windows-query-history-dark.png b/images/windows-query-history-dark.png new file mode 100644 index 0000000..7612293 Binary files /dev/null and b/images/windows-query-history-dark.png differ diff --git a/images/windows-query-history.png b/images/windows-query-history.png new file mode 100644 index 0000000..5a122cf Binary files /dev/null and b/images/windows-query-history.png differ diff --git a/images/windows-table-filter-dark.png b/images/windows-table-filter-dark.png new file mode 100644 index 0000000..92ed3ef Binary files /dev/null and b/images/windows-table-filter-dark.png differ diff --git a/images/windows-table-filter.png b/images/windows-table-filter.png new file mode 100644 index 0000000..a5d801a Binary files /dev/null and b/images/windows-table-filter.png differ diff --git a/images/windows-table-structure-dark.png b/images/windows-table-structure-dark.png new file mode 100644 index 0000000..bea5c37 Binary files /dev/null and b/images/windows-table-structure-dark.png differ diff --git a/images/windows-table-structure.png b/images/windows-table-structure.png new file mode 100644 index 0000000..ff63820 Binary files /dev/null and b/images/windows-table-structure.png differ diff --git a/windows/browsing.mdx b/windows/browsing.mdx new file mode 100644 index 0000000..fcf0d35 --- /dev/null +++ b/windows/browsing.mdx @@ -0,0 +1,119 @@ +--- +title: Browsing a connection +description: Filter a table, read its structure and DDL, open routines and triggers, export results, and find past queries in TablePro for Windows +tag: "Preview" +--- + +Every object in the tree opens in a tab. Tables and views open as rows, and functions, procedures, triggers and sequences open as their source, read only. + +## Filter rows + +Click **Filter** in a table tab, or press `Ctrl+Shift+F`, to show the filter bar above the rows. + + + + The operators match the column's type: text offers **contains** and **starts with**, numbers and dates offer **greater than** and **between**, and every column offers **is NULL**. + + + **between** takes two values. **in list** takes values separated by commas: `3, 7, 12`. + + + Click **Apply** or press `Enter` in a value box. The tab reads the first page again and counts the rows the filter picks. + + + + + Track table filtered to 12 rows, with the filter bar showing GenreId, equals and 5 + Track table filtered to 12 rows, with the filter bar showing GenreId, equals and 5 + + +Add a rule with **+**. With two or more rules, choose **Match all** or **Match any**. **Raw SQL** takes one condition as you would write it after `WHERE`, such as `length(name) > 6`. **Clear** reads the whole table again. + +- A rule missing its value is pointed out before anything runs. +- A filter the database refuses keeps the filter you had, and the results say why. Refresh reads the rows again. +- Changing the filter while edits are pending asks before it discards them. +- The filter stays with the tab when TablePro restarts. + +## Read a table's structure + +Switch a table tab from **Data** to **Structure**. + + + Structure of the Track table on Indexes, listing three foreign key indexes and the primary key + Structure of the Track table on Indexes, listing three foreign key indexes and the primary key + + +| Section | Shows | +|---|---| +| Columns | Name, type, nullable, default, primary key, auto increment, comment | +| Indexes | Name, columns in order with `DESC` where descending, unique, condition of a partial index | +| Foreign keys | Columns, the table and columns they reference, on delete and on update actions | +| DDL | The `CREATE TABLE` statement, with **Copy** | + +The DDL section is empty for a view, whose columns come from its query. Right-click a table in the tree and choose **Show structure** to open it on Structure directly. + +## Open functions, procedures, triggers and sequences + +Click one in the tree to open its source in a read-only tab. **Reload** reads it again from the database, and **Copy** copies it. + + + Trigger track_renamed shown read only with Open in editor, Copy and Reload + Trigger track_renamed shown read only with Open in editor, Copy and Reload + + +**Open in editor** puts the text in a new query tab, where you change it and run it. On MySQL, that tab runs in the database the object belongs to. When running the text would not recreate the object as it is, the button is replaced by a note saying so. + +Which objects show their source depends on the database: + +| Database | Shows the source of | +|---|---| +| PostgreSQL, SQL Server | Functions, procedures, triggers, sequences | +| MySQL, MariaDB | Functions, procedures, triggers, and MariaDB sequences | +| SQLite | Triggers | +| ClickHouse | Functions | + +## Export results + +Choose **File > Export results** or press `Ctrl+Shift+E`. + + + Export results dialog with CSV selected among JSON, Excel, Markdown, HTML and XML + Export results dialog with CSV selected among JSON, Excel, Markdown, HTML and XML + + + + + CSV, JSON, Excel, Markdown, HTML or XML. From a table tab, **SQL INSERT** writes one statement per row for that table. + + + **Current page** writes the rows on screen. **Entire table** reads every row the filter and sort pick, however many pages they span. + + + The file appears only once every row is written. A failed or cancelled export leaves no file behind. + + + +From a query tab, export writes the result shown. Export waits until the run has finished. CSV is the default; pick Excel for a spreadsheet, which holds up to 1,048,575 rows. + +## Find a past query + +Choose **View > Show query history** to open the history beside the tabs. Every query you run in a query tab is kept with its time, duration and outcome, newest first. Type in the search box to find one by any words it contains. + + + Query history pane listing a SELECT COUNT query with its time and duration + Query history pane listing a SELECT COUNT query with its time and duration + + +- Double-click a query, or select it and press `Enter`, to open it in a new query tab. +- Right-click a query to copy or delete it. +- **Clear history** removes the history of every connection, after asking. + +A statement that can hold a password, such as one that creates a user, is never kept. Sorting a result and committing or rolling back a transaction are not kept either. + +## Keyboard shortcuts + +| Action | Shortcut | +|---|---| +| Show or hide the filter bar | `Ctrl+Shift+F` | +| Apply the filter | `Enter` in a value box | +| Export results | `Ctrl+Shift+E` |