Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJEX6-0001b9-UK for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 07:40:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJEX5-0008Cu-UW for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 07:40:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJEWq-0007nu-Iy for pgadmin-hackers@postgresql.org; Fri, 09 Jun 2017 07:40:20 +0000 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJEWl-0003EV-Lp for pgadmin-hackers@postgresql.org; Fri, 09 Jun 2017 07:40:19 +0000 Received: by mail-wr0-x236.google.com with SMTP id v111so26769313wrc.3 for ; Fri, 09 Jun 2017 00:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CVcd9YV45QEUB/C5pEHNGge5er6M04gpsmzKlOFeZ/c=; b=S8T5yPy6I79fqPeKmTx657Tv0Optw2zlhIQWGgITMTI2FcHoOBIYrWkcB8MJp2nCRi mTHvI15mCBaGxU4wCb8NzSu7+bZLZnGhnn8khL/eUEzJZdpOwpty6mLjweqYGe9jfJeB +xpL5jcrij6bxPFB2JI3NImifja5ZDPP9RNkCreda+XEFKyFkeotEfB2otVASea9Ir1z VRuldQMKsLW4pUhSKaM6P5ofg3IW92qWFjDTeqW/dJRny8/Zvs26Hwp12Ec0nAmZXgBm b6p8NIibLdxprbFK8TDf36gCmXuQvcsvUr99bsFFh6ONyrQkNXb3GNo1R8KCtlVTm42J 67Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CVcd9YV45QEUB/C5pEHNGge5er6M04gpsmzKlOFeZ/c=; b=ENbBj31MU5DuUD5oR+PxoDIq5PXctlfBxxQyKHOPOgrm1brY1svHgVzluuIj84XLFY sCIwudIF3Xiggn4SiQ8LrLhstfOI+tdzDs4RBmo673+/MR+/+lC12sDsut4M/QtkSkkz lQNExrspAdeKOSNGiGZszNPYFeDPbH0jlkggRlMXi896TuZ41cNn7QKcdmWnxB4ICcrl xDca6KCfu3q9j1wzOZym3xI+VGDKDwX23ZuUAn80Y1CrKZhYOFH5s7r9SAmAzO2MNLi+ G1Vl+5NGwspn67l6vNs7S/S/nYlvrSYb7QcfCseY/CZd59Ds50BA4IBmarnW+jhS6Evm OERA== X-Gm-Message-State: AODbwcAkdurwc8QUlGbkkIVZ/TDJkBh0jK5GnwMxOLJDQyyyPu8lk2SS NwwtJejkpQyzn3PzSWE5qrTh8n1SRdzq X-Received: by 10.223.131.1 with SMTP id 1mr15225990wrd.123.1496994014341; Fri, 09 Jun 2017 00:40:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.9.208 with HTTP; Fri, 9 Jun 2017 00:39:43 -0700 (PDT) In-Reply-To: References: From: Surinder Kumar Date: Fri, 9 Jun 2017 13:09:43 +0530 Message-ID: Subject: Re: Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool To: Dave Page Cc: Shruti B Iyer , pgadmin-hackers , Matthew Kleiman Content-Type: multipart/mixed; boundary="94eb2c0d205475652d0551821458" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --94eb2c0d205475652d0551821458 Content-Type: multipart/alternative; boundary="94eb2c0d20547565290551821456" --94eb2c0d20547565290551821456 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi As the patch "Improvements to Query Results" =E2=80=8B is merged, the columns width in edit grid needs some adjustments = as 'checkboxes' are removed from columns. =E2=80=8BPFA patch.=E2=80=8B On Thu, Jun 8, 2017 at 5:12 PM, Dave Page wrote: > Nice! Thanks, patch applied. > > On Wed, Jun 7, 2017 at 4:03 PM, Surinder Kumar > wrote: > > PFA patch after rebase > > > > On Wed, Jun 7, 2017 at 6:26 PM, Surinder Kumar > > wrote: > >> > >> Hi > >> > >> Please find rebased patch. > >> > >> On Wed, Jun 7, 2017 at 6:15 PM, Dave Page wrote: > >>> > >>> Hi, > >>> > >>> Could you rebase this please? > >>> > >>> Thanks. > >>> > >>> On Tue, Jun 6, 2017 at 9:22 AM, Surinder Kumar > >>> wrote: > >>> > Hi All, > >>> > > >>> > Please find updated patch which includes Jasmine test cases for > >>> > functions > >>> > getHash and calculateColumnWidth > >>> > > >>> > Thanks, > >>> > Surinder > >>> > > >>> > On Mon, Jun 5, 2017 at 11:38 PM, Shruti B Iyer > >>> > wrote: > >>> >> > >>> >> Hi Surinder! > >>> >> > >>> >> We reviewed this patch. The changes look good and we especially li= ke > >>> >> that > >>> >> you have extracted out the new utility functions and the > >>> >> epicRandomString > >>> >> function too. > >>> >> > >>> >> This patch will likely affect the Query Results patch that is > >>> >> currently > >>> >> under review. In order to assist either us or yourself when making= a > >>> >> merge > >>> >> between these patches, it would help to have jasmine unit testing > for > >>> >> the > >>> >> two new functions, getHash and calculate_column_width. > >>> >> > >>> >> Also, we suggest that you rename calculate_column_width to > >>> >> calculateColumnWidth for consistency with javascript code style. > >>> >> > >>> >> Thanks, > >>> >> Shruti and Matt > >>> >> > >>> >> On Mon, Jun 5, 2017 at 9:16 AM Surinder Kumar > >>> >> wrote: > >>> >>> > >>> >>> Staged changes are missed in previous patch, so please ignore. > >>> >>> Please find attached updated patch. > >>> >>> > >>> >>> On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar > >>> >>> wrote: > >>> >>>> > >>> >>>> 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 whi= ch > >>> >>>> 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 colu= mn > >>> >>>> 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 has= h) > >>> >>>> for > >>> >>>> such queries ? > >>> >>>> > >>> >>>> Also, Moved utilities functions into pgadmin/static/utils.js > >>> >>>> > >>> >>>> Please find attached patch and review. > >>> >>>> > >>> >>>> Thanks, > >>> >>>> Surinder Kumar > >>> >>> > >>> >>> > >>> >>> > >>> >>> -- > >>> >>> Sent via pgadmin-hackers mailing list > >>> >>> (pgadmin-hackers@postgresql.org) > >>> >>> To make changes to your subscription: > >>> >>> http://www.postgresql.org/mailpref/pgadmin-hackers > >>> > > >>> > > >>> > > >>> > > >>> > -- > >>> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.or > g) > >>> > To make changes to your subscription: > >>> > http://www.postgresql.org/mailpref/pgadmin-hackers > >>> > > >>> > >>> > >>> > >>> -- > >>> Dave Page > >>> Blog: http://pgsnake.blogspot.com > >>> Twitter: @pgsnake > >>> > >>> EnterpriseDB UK: http://www.enterprisedb.com > >>> The Enterprise PostgreSQL Company > >> > >> > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --94eb2c0d20547565290551821456 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi<= /div>

As th= e patch "Improvements to Query Results"
=E2=80=8B is merged, the column= s width in edit grid needs some adjustments as 'checkboxes' are rem= oved from columns.

=E2=80=8BPFA patch.=E2=80=8B

On Thu, Jun 8, 2017 at 5:12 PM, Dave = Page <dpage@pgadmin.org> wrote:
Nice! Thanks, patch applied.

On Wed, Jun 7, 2017 at 4:03 PM, Surinder Kumar
<surinder.kumar@enterprised= b.com> wrote:
> PFA patch after rebase
>
> On Wed, Jun 7, 2017 at 6:26 PM, Surinder Kumar
> <surinder.kumar@enterprisedb.com> wrote:
>>
>> Hi
>>
>> Please find rebased patch.
>>
>> On Wed, Jun 7, 2017 at 6:15 PM, Dave Page <dpage@pgadmin.org> wrote:
>>>
>>> Hi,
>>>
>>> Could you rebase this please?
>>>
>>> Thanks.
>>>
>>> On Tue, Jun 6, 2017 at 9:22 AM, Surinder Kumar
>>> <surinder.kumar@enterprisedb.com> wrote:
>>> > Hi All,
>>> >
>>> > Please find updated patch which includes Jasmine test cas= es for
>>> > functions
>>> > getHash and calculateColumnWidth
>>> >
>>> > Thanks,
>>> > Surinder
>>> >
>>> > On Mon, Jun 5, 2017 at 11:38 PM, Shruti B Iyer <siyer@pivotal.io>
>>> > wrote:
>>> >>
>>> >> Hi Surinder!
>>> >>
>>> >> We reviewed this patch. The changes look good and we = especially like
>>> >> that
>>> >> you have extracted out the new utility functions and = the
>>> >> epicRandomString
>>> >> function too.
>>> >>
>>> >> This patch will likely affect the Query Results patch= that is
>>> >> currently
>>> >> under review. In order to assist either us or yoursel= f when making a
>>> >> merge
>>> >> between these patches, it would help to have jasmine = unit testing for
>>> >> the
>>> >> two new functions, getHash and calculate_column_width= .
>>> >>
>>> >> Also, we suggest that you rename calculate_column_wid= th to
>>> >> calculateColumnWidth for consistency with javascript = code style.
>>> >>
>>> >> Thanks,
>>> >> Shruti and Matt
>>> >>
>>> >> On Mon, Jun 5, 2017 at 9:16 AM Surinder Kumar
>>> >> <surinder.kumar@enterprisedb.com> wrote:
>>> >>>
>>> >>> Staged changes are missed in previous patch, so p= lease ignore.
>>> >>> Please find attached updated patch.
>>> >>>
>>> >>> On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar
>>> >>> <surinder.kumar@enterprisedb.com> wrote:=
>>> >>>>
>>> >>>> Hi
>>> >>>>
>>> >>>> This patch contains two fixes:
>>> >>>>
>>> >>>> 1) In Query/tool or Edit grid, the width of t= able column header is
>>> >>>> fixed
>>> >>>> depending on the column type(int, boolean, ch= ar etc.) due to which
>>> >>>> the
>>> >>>> column name or type appears cut from right an= d doesn't looks good
>>> >>>> from user
>>> >>>> point of view. The main concern was to displa= y 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 qu= ery.
>>> >>>>
>>> >>>> The approach is to extract table name from th= e query executed and
>>> >>>> use it
>>> >>>> to store its columns width.
>>> >>>> Whenever the column(s) width of a table is ad= justed, the
>>> >>>> corresponding
>>> >>>> values are updated into the object and used e= very time the same
>>> >>>> query is
>>> >>>> executed.
>>> >>>>
>>> >>>> If a query is executed for e.g:
>>> >>>>
>>> >>>> SELECT generate_series(1, 1000) as id, genera= te_series(1, 1000) as
>>> >>>> name,
>>> >>>> generate_series(1, 1000) as age
>>> >>>>
>>> >>>> it
>>> >>>> displays 3 columns
>>> >>>> but don't have any table name. In that ca= se,
>>> >>>>=C2=A0 i use a hash generator function which r= eturns 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
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Sent via pgadmin-hackers mailing list
>>> >>> (pgadmin-hackers@postgresql.org)
>>> >>> To make changes to your subscription:
>>> >>> http://www.postgresql.or= g/mailpref/pgadmin-hackers
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresq= l.org)
>>> > To make changes to your subscription:
>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>> >
>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>
>>
>



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

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

--94eb2c0d20547565290551821456-- --94eb2c0d205475652d0551821458 Content-Type: application/octet-stream; name="adjust_columns_width.patch" Content-Disposition: attachment; filename="ad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isgICAgICAgICAgICAgIGNvbHVtbl9zaXplW3Rh YmxlX25hbWVdW2MubmFtZV0gPSBvcHRpb25zWyd3aWR0aCddOwogICAgICAg ICAgICAgfQogICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAg b3B0aW9uc1snd2lkdGgnXSA9IGNvbHVtbl9zaXplW3RhYmxlX25hbWVdW2Mu bmFtZV07CisgICAgICAgICAgICAgIG9wdGlvbnNbJ3dpZHRoJ10gPSBjb2x1 bW5fc2l6ZVt0YWJsZV9uYW1lXVtjLm5hbWVdOwogICAgICAgICAgICAgfQog CiAgICAgICAgICAgICAvLyBJZiBncmlkIGlzIGVkaXRhYmxlIHRoZW4gYWRk IGVkaXRvciBlbHNlIG1ha2UgaXQgcmVhZG9ubHkK --94eb2c0d205475652d0551821458 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --94eb2c0d205475652d0551821458--