mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
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.
This commit is contained in:
committed by
Dave Page
parent
beb06a4c76
commit
710d520631
@@ -45,6 +45,9 @@ class StartRunningQuery:
|
||||
if type(session_obj) is Response:
|
||||
return session_obj
|
||||
|
||||
# Remove any existing primary keys in session_obj
|
||||
session_obj.pop('primary_keys', None)
|
||||
|
||||
transaction_object = pickle.loads(session_obj['command_obj'])
|
||||
can_edit = False
|
||||
can_filter = False
|
||||
|
||||
Reference in New Issue
Block a user