Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIvpW-0001mr-PT for pgadmin-hackers@arkaria.postgresql.org; Thu, 08 Jun 2017 11:42:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dIvpW-00069P-Bw for pgadmin-hackers@arkaria.postgresql.org; Thu, 08 Jun 2017 11:42:22 +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 1dIvpV-00064m-SE for pgadmin-hackers@postgresql.org; Thu, 08 Jun 2017 11:42:21 +0000 Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dIvpS-0005nS-9j for pgadmin-hackers@postgresql.org; Thu, 08 Jun 2017 11:42:21 +0000 Received: by mail-io0-x235.google.com with SMTP id b184so18882567ioe.0 for ; Thu, 08 Jun 2017 04:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZUiBbq9OyfiGMTEeNzFrL5SrdP/IJdZqTLy+UbZyC9g=; b=znqVw0QXIbu3koUTvrqC4BxeKXOXwuPDM96JDFLuucVOj06j7mK1XVizyOCDEHTSkd aVGyt7ApM7186wONGzhiuwZCiHhscU4+Bh74nZd1IqDn5+XFERMvzhcr0DV84oqHpay3 kciUoqUQAOJ11NOr165EUnkIJ0EmKyA54L4B1W3zuXSi3nIeTLv0wjGAQRlbbxDf3IFa oY96LP11cnudQyrGHabiZ2vuZiQWJypHedGCC9pdlRM/t6kj1POciEFSC/1lnTlwCVx0 rP8jTwd1KmdTdeIhmE98FvLua14p5QAjmV5bLACYSe79kKUouGL994WWDr4+zElMBP3b EeXw== 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=ZUiBbq9OyfiGMTEeNzFrL5SrdP/IJdZqTLy+UbZyC9g=; b=QumI1DWEXsmNeeMO4ckAEjcs6B46GYCRE8fy7R6f1WlcZx1urjdSOY+7EK7ORdqRaF T/1tXflePXwLeZQdwnQuK0ZELgwzZFd7yDnFS94CiN3IGgfckl0CVm4GoSzyP70JRdmz GZb7HWMKeXT5bLNWb71ZXK/QujlDHk+uKTzAxyjTZ8ekjC/biix6hy0Lv/a77Wtnn0dA 0gwqtCRzE1PaYpRKMVoeejuaRbve3LjxUU4NIOOVgfA9LBW+XgwnflYCRtJ2+9KsHoyK Qzld4po1zsJMqg5x1t7hgZTMOMmE638lEm+TnLN7MVzY5J8/oZrLMCRQfaP9sh6Hy0YK uQhw== X-Gm-Message-State: AODbwcDxttdnAdUdWkHVUZf6RURVz9v53k5j9/BpEw8IxlNgyRvWWVIf weCo5YUVhKf8IHo4pirv8U8TJV7DjjTh X-Received: by 10.107.19.131 with SMTP id 3mr14810962iot.232.1496922136731; Thu, 08 Jun 2017 04:42:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Thu, 8 Jun 2017 04:42:16 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Thu, 8 Jun 2017 12:42:16 +0100 Message-ID: Subject: Re: Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool To: Surinder Kumar Cc: Shruti B Iyer , pgadmin-hackers , Matthew Kleiman Content-Type: text/plain; charset="UTF-8" X-Pg-Spam-Score: -2.6 (--) 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 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 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 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 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 >>> >>> >>> >>> >>> >>> >>> >>> -- >>> >>> 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.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 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers