Subject: pgAdmin 4 commit: Add support for editing of resultsets in the Query To

From: Dave Page <[email-masked]>
Date: Wed, 17 Jul 2019 10:45:26 +0000

Add support for editing of resultsets in the Query Tool, if the data can be identified as updatable. Fixes #1760

When a query is run in the Query Tool, check if the source of the columns
can be identified as being from a single table, and that we have all
columns that make up the primary key. If so, consider the resultset to
be editable and allow the user to edit data and add/remove rows in the
grid. Changes to data are saved using SAVEPOINTs as part of any
transaction that's in progress, and rolled back if there are integrity
violations, without otherwise affecting the ongoing transaction.

Implemented by Yosry Muhammad as a Google Summer of Code project.

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=710d520631b1b4649eb4a8d924e3141ff74af449
Author: Yosry Muhammad <[email-masked]>

Modified Files
--------------
docs/en_US/editgrid.rst                            |   8 +-
docs/en_US/images/query_output_data.png            | Bin 83700 -> 50204 bytes
docs/en_US/images/query_tool.png                   | Bin 85347 -> 50204 bytes
docs/en_US/images/query_toolbar.png                | Bin 20230 -> 7820 bytes
docs/en_US/keyboard_shortcuts.rst                  |   2 +
docs/en_US/preferences.rst                         |   4 +
docs/en_US/query_tool.rst                          |  28 +-
docs/en_US/query_tool_toolbar.rst                  |   9 +-
docs/en_US/release_notes_4_11.rst                  |   1 +
web/pgadmin/feature_tests/file_manager_test.py     |   3 +-
web/pgadmin/feature_tests/locators.py              |   2 +-
.../feature_tests/query_tool_journey_test.py       |  75 ++
web/pgadmin/feature_tests/view_data_dml_queries.py |   2 +-
web/pgadmin/static/js/keyboard_shortcuts.js        |   4 +
.../static/js/sqleditor/call_render_after_poll.js  |   3 +-
web/pgadmin/static/js/sqleditor/execute_query.js   |  12 +
.../static/js/sqleditor/query_tool_actions.js      |   5 +
.../static/js/sqleditor/query_tool_preferences.js  |   6 +-
web/pgadmin/static/scss/_alertify.overrides.scss   |   2 +-
.../tools/datagrid/templates/datagrid/index.html   |  10 +-
web/pgadmin/tools/sqleditor/__init__.py            |  80 ++-
web/pgadmin/tools/sqleditor/command.py             | 364 +++-------
.../tools/sqleditor/static/css/sqleditor.css       |   6 +-
.../sqleditor/static/img/save_data_changes.svg     |  12 +
web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 759 +++++++++++++--------
.../tools/sqleditor/static/scss/_sqleditor.scss    |   7 +
.../sqleditor/sql/11_plus/primary_keys.sql         |   2 +-
.../sqleditor/sql/default/primary_keys.sql         |   4 +-
.../tools/sqleditor/tests/execute_query_utils.py   |  41 ++
.../tests/test_is_query_resultset_updatable.py     | 125 ++++
.../sqleditor/tests/test_save_changed_data.py      | 347 ++++++++++
.../utils/is_query_resultset_updatable.py          | 120 ++++
.../sqleditor/utils/query_tool_preferences.py      |  29 +
.../tools/sqleditor/utils/save_changed_data.py     | 310 +++++++++
.../tools/sqleditor/utils/start_running_query.py   |   3 +
.../sqleditor/call_render_after_poll_spec.js       |  25 +-
.../sqleditor/keyboard_shortcuts_spec.js           |  46 ++
web/regression/runtests.py                         |   1 +
38 files changed, 1860 insertions(+), 597 deletions(-)