Updated documentation for the new query tool.

refs #6131
This commit is contained in:
Akshay Joshi 2022-04-26 16:18:28 +05:30
parent 25b89f7624
commit 4f9eaf850d
43 changed files with 118 additions and 104 deletions

View File

@ -215,8 +215,7 @@ To add new column(s) in data sorting grid, click on the [+] icon.
To delete a row from the grid, click the trash icon.
* Click the *Help* button (?) to access online help.
* Click the *Ok* button to save work.
* Click the *Save* button to save work.
* Click the *Close* button to discard current changes and close the dialog.
.. toctree::

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 443 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

@ -310,8 +310,14 @@ The Query History tab displays information about recent commands:
You can show or hide the queries generated internally by pgAdmin (during
'View/Edit Data' or 'Save Data' operations).
To erase the content of the *Query History* tab, select *Clear history* from
the *Clear* drop-down menu.
You can remove a single query by selecting it and clicking on the *Remove*
button. If you would like to remove all of the histories from the
*Query History* tab, then click on the *Remove All* button.
By using the *Copy* button, you can copy a particular query to the clipboard,
and with the *Copy to Query Editor* button, you can copy a specific query to
the Query Editor tab. During this operation, all existing content in the
Query Editor is erased.
Query History is maintained across sessions for each database on a per-user
basis when running in Query Tool mode. In View/Edit Data mode, history is not
@ -339,13 +345,13 @@ User can connect to another server or database from existing open session of que
* Click on the connection link next to connection status.
* Now click on the *<New Connection>* option from the dropdown.
.. image:: images/new_connection_options.png
.. image:: images/query_tool_new_connection_options.png
:alt: Query tool connection options
:align: center
* Now select server, database, user, and role to connect and click OK.
* Now select server, database, user, and role to connect and click on the 'Save' button.
.. image:: images/new_connection_dialog.png
.. image:: images/query_tool_new_connection_dialog.png
:alt: Query tool connection dialog
:align: center
@ -367,24 +373,13 @@ To create a macro, select the *Manage Macros* option from the *Macros* menu on t
:alt: Query Tool Manage Macros dialogue
:align: center
To clear a macro, select the macro on the *Manage Macros* dialogue, and then click the *Clear* button.
.. image:: images/query_tool_macros_clear_row.png
:alt: Query Tool Manage Macros clear the row
:align: center
The server will prompt you for confirmation to clear the macro.
To delete a macro, select the macro on the *Manage Macros* dialogue, and then click the *Delete* button.
The server will prompt you for confirmation to delete the macro.
.. image:: images/query_tool_macros_clear_confirmation.png
:alt: Query Tool Manage Macros Clear row confirmation
:align: center
To clear all macros, click on the *Clear* button on left side of the key. The server will prompt you for confirmation to clear all the rows.
.. image:: images/query_tool_macros_clear_all.png
:alt: Query Tool Macros Clear All
:align: center
To execute a macro, simply select the appropriate shortcut keys, or select it from the *Macros* menu.
.. image:: images/query_tool_macros_execution.png

View File

@ -40,8 +40,8 @@ File Options
| | selected content of the SQL Editor panel. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
Editing Options
***************
Filter/Limit Options
********************
.. table::
:class: longtable
@ -50,71 +50,11 @@ Editing Options
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| Icon | Behavior | Shortcut |
+======================+===================================================================================================+================+
| *Save Data Changes* | Click the *Save Data Changes* icon to save data changes (insert, update, or delete) in the Data | F6 |
| | Output Panel to the server. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Find* | Use the *Find* menu to search, replace, or navigate the code displayed in the SQL Editor: | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Find* to provide a search target, and search the SQL Editor contents. | Cmd+F |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Find next* to locate the next occurrence of the search target. | Cmd+G |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Find previous* to move to the last occurrence of the search target. | Cmd+Shift+G |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Persistent find* to identify all occurrences of the search target within the editor. | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Replace* to locate and replace (with prompting) individual occurrences of the target. | Cmd+Shift+F |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Replace all* to locate and replace all occurrences of the target within the editor. | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Jump* to navigate to the next occurrence of the search target. | Alt+G |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Copy* | Click the *Copy* icon to copy the content with or without header: | Accesskey + C |
| *Filter* | Click the *Filter* icon to set filtering and sorting criteria for the data when in *View/Edit data| Accesskey + F |
| | mode*. Click the down arrow to access other filtering and sorting options: | |
| | | |
| | * Click the *Copy* icon to copy the content that is currently highlighted in the Data Output | |
| | panel. | |
| | | |
| | * Click *Copy with headers* to copy the highlighted content along with the header. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Paste* | Click the *Paste* icon to paste a previously copied row into a new row. | Accesskey + P |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Delete* | Click the *Delete* icon to mark the selected rows for deletion. These marked rows get deleted |Accesskey + D |
| | when you click the *Save Data Changes* icon. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Edit* | Use options on the *Edit* menu to access text editing tools; the options operate on the text | |
| | displayed in the SQL Editor panel when in Query Tool mode: | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Indent Selection* to indent the currently selected text. | Tab |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Unindent Selection* to remove indentation from the currently selected text. | Shift+Tab |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Inline Comment Selection* to enclose any lines that contain the selection in SQL style | Cmd+/ |
| | comment notation. | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Inline Uncomment Selection* to remove SQL style comment notation from the selected line. | Cmd+. |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Block Comment* to enclose all lines that contain the selection in C style comment | Shift+Cmd+/ |
| | notation. This option acts as a toggle. | |
| +---------------------------------------------------------------------------------------------------+----------------+
| | Select *Format SQL* to format the selected SQL or all the SQL if none is selected | Shift+Cmd+K |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
View/Edit Data Resultset Control
********************************
.. table::
:class: longtable
:widths: 1 4 1
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| Icon | Behavior | Shortcut |
+======================+===================================================================================================+================+
| *Filter* | Click the *Filter* icon to set filtering and sorting criteria for the data when in View/Edit data | Accesskey + F |
| | mode. Click the down arrow to access other filtering and sorting options: | |
| | | |
| | * Click *Sort/Filter* to open the sorting and filtering dialogue. In the *SQL Filter*, you can | |
| | enter a SQL query as filtering criteria. In *Data Sorting*, you can select the column and | |
| | specify the order for sorting. | |
| | * In the *SQL Filter*, you can enter a SQL query as filtering criteria. | |
| | In *Data Sorting*, you can select the column and specify the order for sorting. | |
| | | |
| | * Click *Filter by Selection* to show only the rows containing the values in the selected cells. | |
| | | |
@ -125,12 +65,48 @@ View/Edit Data Resultset Control
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| Limit Selector | Select a value in the *Limit Selector* to limit the size of the dataset to a number of rows. | Accesskey + R |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Stop* | Click the *Stop* icon to cancel the execution of the currently running query. | Accesskey + Q |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
Query Editing Options
*********************
.. image:: images/query_editing.png
:alt: Query tool editing options
:align: center
.. table::
:class: longtable
:widths: 1 4 1
+----------------------+---------------------------------------------------------------------------------------------------+-----------------------+
| Icon | Behavior | Shortcut |
+======================+===================================================================================================+=======================+
| *Edit* | Use the *Edit* menu to search, replace, or navigate the code displayed in the SQL Editor: | |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Find* to provide a search target, and search the SQL Editor contents. | Cmd+F |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Replace* to locate and replace (with prompting) individual occurrences of the target. | Option+Cmd+F (MAC) |
| | | Ctrl+Shift+F (Others) |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Jump* to navigate to the next occurrence of the search target. | Alt+G |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Indent Selection* to indent the currently selected text. | Tab |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Unindent Selection* to remove indentation from the currently selected text. | Shift+Tab |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Toggle Comment* to comment/uncomment any lines that contain the selection in SQL style. | Cmd+/ |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Clear Query* to clear the query editor window. | Cmd+. |
| +---------------------------------------------------------------------------------------------------+-----------------------+
| | Select *Format SQL* to format the selected SQL or all the SQL if none is selected | Shift+Cmd+K |
+----------------------+---------------------------------------------------------------------------------------------------+-----------------------+
Query Execution
***************
.. image:: images/query_execution.png
:alt: Query tool execute options
:align: center
.. table::
:class: longtable
:widths: 1 4 1
@ -138,6 +114,8 @@ Query Execution
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| Icon | Behavior | Shortcut |
+======================+===================================================================================================+================+
| *Stop* | Click the *Stop* icon to cancel the execution of the currently running query. | Accesskey + Q |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Execute/Refresh* | Click the *Execute/Refresh* icon to either execute or refresh the query highlighted in the SQL | F5 |
| | editor panel. Click the down arrow to access other execution options: | |
| | | |
@ -173,17 +151,59 @@ Query Execution
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Rollback* | Click the *Rollback* icon to rollback the transaction. | Shift+CTRL+R |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Clear* | Use options on the *Clear* drop-down menu to erase display contents: | Accesskey + L |
| *Macros* | Click the *Macros* icon to manage the macros. You can create, edit or clear the macros through | |
| | the *Manage Macros* option. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
Data Editing Options
********************
.. image:: images/query_data_editing.png
:alt: Query tool data editing options
:align: center
.. table::
:class: longtable
:widths: 1 4 1
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| Icon | Behavior | Shortcut |
+======================+===================================================================================================+================+
| *Add row* | Click the *Add row* icon to add a new row | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Copy* | Click the *Copy* icon to copy the content with or without header: | Accesskey + C |
| | | |
| | * Select *Clear Query Window* to erase the content of the SQL Editor panel. | |
| | * Click the *Copy* icon to copy the content that is currently highlighted in the Data Output | |
| | panel. | |
| | | |
| | * Select *Clear History* to erase the content of the *History* tab. | |
| | * Click *Copy with headers* to copy the highlighted content along with the header. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Paste* | Click the *Paste* icon to paste a previously copied row into a new row. | Accesskey + P |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Delete* | Click the *Delete* icon to mark the selected rows for deletion. These marked rows get deleted | Accesskey + D |
| | when you click the *Save Data Changes* icon. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Save Data Changes* | Click the *Save Data Changes* icon to save data changes (insert, update, or delete) in the Data | F6 |
| | Output Panel to the server. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Save results to* | Click the Save results to file icon to save the result set of the current query as a delimited | F8 |
| *file* | text file (CSV, if the field separator is set to a comma). This button will only be enabled when | |
| | a query has been executed and there are results in the data grid. You can specify the CSV/TXT | |
| | settings in the Preference Dialogue under SQL Editor -> CSV/TXT output. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Macros* | Click the *Macros* icon to manage the macros. You can create, edit or clear the macros through | |
| | the *Manage Macros* option. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
Status Bar
**********
.. image:: images/query_status_bar.png
:alt: Query tool status bar
:align: center
The status bar shows the following information:
* **Total rows**: The total number of rows returned by the query.
* **Query complete**: The time is taken by the query to complete.
* **Rows selected**: The number of rows selected in the data output panel.
* **Changes staged**: This information showed the number of rows added, deleted, and updated.
* **Ln**: In the Query tab, it is the line number at which the cursor is positioned.
* **Col**: In the Query tab, it is the column number at which the cursor is positioned

View File

@ -549,13 +549,13 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'jumpToLine');}}>{gettext('Jump')}</PgMenuItem>
<PgMenuDivider />
<PgMenuItem shortcut={FIXED_PREF.indent}
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'indentMore');}}>{gettext('Indent')}</PgMenuItem>
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'indentMore');}}>{gettext('Indent Selection')}</PgMenuItem>
<PgMenuItem shortcut={FIXED_PREF.unindent}
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'indentLess');}}>{gettext('Unindent')}</PgMenuItem>
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'indentLess');}}>{gettext('Unindent Selection')}</PgMenuItem>
<PgMenuItem shortcut={FIXED_PREF.comment}
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'toggleComment');}}>{gettext('Toggle comment')}</PgMenuItem>
onClick={()=>{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_EXEC_CMD, 'toggleComment');}}>{gettext('Toggle Comment')}</PgMenuItem>
<PgMenuItem shortcut={queryToolPref.clear_query}
onClick={clearQuery}>{gettext('Clear query')}</PgMenuItem>
onClick={clearQuery}>{gettext('Clear Query')}</PgMenuItem>
<PgMenuDivider />
<PgMenuItem shortcut={FIXED_PREF.format_sql}onClick={formatSQL}>{gettext('Format SQL')}</PgMenuItem>
</PgMenu>