[pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool
Date: 2017-06-05 10:59:52
Message-ID: CAM5-9D8qbLXBzs3rAjAMUZtj32hDNV11rnymXgxUfKePkqL-rQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

This patch contains two fixes:

1) In Query/tool or Edit grid, the width of table column header is fixed
depending on the column type(int, boolean, char etc.) due to which the
column name or type appears cut from right and doesn't looks good from user
point of view. The main concern was to display as much as the content of
column should be displayed.

Now the width of column is decided using the text length of column name or
column type so that the column takes exact width it required and it don't
appears cut.

2) Remember column size after re-running a query.

The approach is to extract table name from the query executed and use it to
store its columns width.
Whenever the column(s) width of a table is adjusted, the corresponding
values are updated into the object and used every time the same query is
executed.

If a query is executed for e.g:

SELECT generate_series(1, 1000) as id, generate_series(1, 1000) as name,
generate_series(1, 1000) as age

​it ​
displays 3 columns
​but don't have any table name. In that case,
i use a hash generator function which returns unique hash for a query
written in query editor and adjusted column(s) width are stored against
that hash in object.

Is there any way to get temporary table name(avoiding unique hash) for such
queries ?​

Also, Moved utilities functions into pgadmin/static/utils.js

Please find attached patch and review.

Thanks,
Surinder Kumar

Attachment Content-Type Size
Feature_1971.patch application/octet-stream 10.1 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2017-06-05 13:09:53 Re: [pgAdmin4][PATCH] Improvements to Query Results Grid User Experience
Previous Message Murtuza Zabuawala 2017-06-05 10:38:48 [pgAdmin4][PATCH] To fix the issue in Synonym node EPAS9.2