Re: [GSoC][New Feature] Editable and Read-only Columns - Mailing list pgadmin-hackers

From Aditya Toshniwal
Subject Re: [GSoC][New Feature] Editable and Read-only Columns
Date
Msg-id CAM9w-_mhOedYa-K9M6W7bFYmeVwHjCx1bke9q1nj8sMockv-RQ@mail.gmail.com
Whole thread Raw
In response to Re: [GSoC][New Feature] Editable and Read-only Columns  (Dave Page <dpage@pgadmin.org>)
Responses Re: [GSoC][New Feature] Editable and Read-only Columns  (Yosry Muhammad <yosrym93@gmail.com>)
List pgadmin-hackers
Hi Yosry,

Nice work there !! :)
Few suggestions:
1) Wrap texts like "tooltip = 'Editable column' " in gettext so that they are translated to language selected.
2) One of the api test case is failing. I tried on PG 9.4, Python 3.5. Tested 2 times.
======================================================================
FAIL: runTest (pgadmin.tools.sqleditor.utils.tests.test_is_query_resultset_updatable.TestQueryUpdatableResultset)
When renaming a column to a primary key name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/adityatoshniwal/projects/pgadmin4/web/pgadmin/tools/sqleditor/utils/tests/test_is_query_resultset_updatable.py", line 100, in runTest
    self._check_primary_keys(response_data)
  File "/Users/adityatoshniwal/projects/pgadmin4/web/pgadmin/tools/sqleditor/utils/tests/test_is_query_resultset_updatable.py", line 119, in _check_primary_keys
    self.assertEquals(primary_keys, self.primary_keys)
AssertionError: {'pk_col1': 'int4', 'pk_col2': 'int4'} != None
3) For table containing geometry columns, the lock icon is not shown for non-editable columns. Instead, geometry view icon is shown. Also the data type is incorrect. Below is the screenshot. Please note, this seems to be happening only for text columns.
Screenshot 2019-08-22 at 11.13.53.pngScreenshot 2019-08-22 at 11.18.33.png

On Wed, Aug 21, 2019 at 4:01 PM Dave Page <dpage@pgadmin.org> wrote:
Aditya, can you review this please?

Thanks.

On Thu, Aug 15, 2019 at 8:01 PM Yosry Muhammad <yosrym93@gmail.com> wrote:
Hi, hackers !

Please find attached a work-in-progress patch adding a new feature to the Query Tool on top of updatable result-sets.

This patch allows individual columns of an updatable result-set to be editable or read-only. This allows for a wider variety of updatable result-sets, for example:

- Result-sets with duplicated columns.
- Result-sets with renamed columns (if a column is renamed to a primary key name, the real primary key can be correctly identified) .
- Result-sets including columns that are not selected directly from a table (e.g concatenation of 2 columns or system columns).

In the above cases, these columns would be read-only while other columns of the result-set are editable. Editable/Read-only columns are identified by icons and tooltips in the column header.

This is still a work-in-progress, updates to tests and documentation is still due. Looking forward to your thoughts and feedback!

Also, do you think the editable/read-only icons should apply in both View/Edit Data and Query Tool for consistency? or hidden from View/Edit Data as all columns are editable anyway?

Thanks.

--
Yosry Muhammad Yosry

Computer Engineering student,
The Faculty of Engineering,
Cairo University (2021).
Class representative of CMP 2021.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: pgAdmin 4 commit: Move schema precondition logic into separate function
Next
From: Aditya Toshniwal
Date:
Subject: [pgAdmin][RM4553] Query tool UX improvement