Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hg087-0005p7-Uk for pgadmin-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 05:06:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hg086-00055y-Ff for pgadmin-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 05:05:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hg085-00055r-TA for pgadmin-hackers@lists.postgresql.org; Wed, 26 Jun 2019 05:05:58 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hg082-0005lr-8U for pgadmin-hackers@postgresql.org; Wed, 26 Jun 2019 05:05:56 +0000 Received: by mail-lf1-x129.google.com with SMTP id x144so596273lfa.9 for ; Tue, 25 Jun 2019 22:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Wcy+DTfI+zL110ullus4G2V/rmMTPc308ZnbB+6FC/c=; b=haiA4I5bbYR3gKzlx38cCfvaweaW8U3u6sIzT+QlUTE0mxnKlH4eHPDl+hHpobQoOw klR27x4yFJZbvdQnvSzNQGJO5lblyBcZtCokaPNEhfchKgVT7SqDqcWO9ghOnSCGZhO4 8dypfEi1kzW+8Rk+nGSDLn4qnhQhXi9TyTpoYsa+7MgSICDwYK7g3Td1WRiKf+C6TToI nx07TGIpGjH2zDwif6MN3gomw3s+PaT938yaOdXWDovZQQgN0wG0YQYQ6qpK/a4Lt3oo KRAfJmpYkf14KXAJeaayfig5HLQhXI+a+d4ZZeOkXnOqg6CU0fdG5S5ObbdNuWh2xspj EDLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Wcy+DTfI+zL110ullus4G2V/rmMTPc308ZnbB+6FC/c=; b=fMoqRysjNOcgum6u2bniKSWLnDGOrzTeYwOH6Jgq2yAybMJDmj3UZLHymCFCJ3nZY8 XjWqYOAy/PTh3spXBP1iUJgfiWvkMqan4+fKZsimy7P+c26wdqUHW25h5QDS+Th7X7QD V6sbEacnqEHbLxvvEnNJ7ZGSIYufaXMn65GybNEkiWZpeBR2XkV+sifZ9CHhsRXxvzuK GFhlL/4G9MbPtbEz0Vyip+tuSxq7dGzJKZU0vlLAGq4DBLTF/XMJbX6r+JHzG5PNioRT lMuDJua8b3gM2nhbHRy9btjEOeWHqtopUs6mKmcpEZP8VS6IKWuIVttilBGPMU0hl8am vtXg== X-Gm-Message-State: APjAAAXvUaN1XJIeH757Wet3DawwTm4NHAnuwW2lugmED7IhLDHV2172 qi0YqqoCzvnXjBUdRPiJkpAIkyllQShptUQRJrO1UQ== X-Google-Smtp-Source: APXvYqzIXB+LQNAFXJCxWSsdzIs+bxb5d5Rc5fharSDGj6qwMGIPVaAzrdd8sVPkB+vwDWESYah1t+44QkgnT2JI53E= X-Received: by 2002:a19:c14f:: with SMTP id r76mr1497074lff.70.1561525551086; Tue, 25 Jun 2019 22:05:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Wed, 26 Jun 2019 10:35:14 +0530 Message-ID: Subject: Re: [GSoC][Patch] Automatic Mode Detection V1 To: Yosry Muhammad Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000c7de8f058c32ff9b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c7de8f058c32ff9b Content-Type: text/plain; charset="UTF-8" Hi Yosry, On Tue, Jun 25, 2019 at 8:46 PM Yosry Muhammad wrote: > Hi, > > > OK. Yosry, How about storing the mogirfied query in the cookie/session >> when the query is executed and then modifying query history storing logic >> to use it when called ? This way you will not need to change any parsing >> when query history is displayed. >> >>> -- >>> >> > My problem is not where to store the mogrified query, I can just replace > the sql sent with the response to saving the data with the mogrified one. > In order to produce the mogrified query in the first place I need a > psycopg2.cursor object, but I only have access to a Connection object (the > wrapper, not the actual psycopg2.connection object). Should I modify that > wrapper Connection class to add a mogirfy function? or just get a cursor > using the psycopg2.connection object like this: conn.conn.cursor() - which > doesn't seem right. Thoughts? > That would be the way. But I think web/pgadmin/utils/driver/psycopg2/cursor.py will be corrrect place to add the mogrify function. Please note, psycopg2 does not support (,),% in the parameter names. So if the column names has any of these characters, mogrify might fail. Although it is handled with pgadmin_alias (line 493 - web/pgadmin/tools/sqleditor/__init__.py), please test this case as well. > > Also, could you please help me with the selenium TimeoutException in the > feature tests? 3 tests are failing because of that exception and I am not > sure what is it related to. I am attaching the feature test log file in > this email if you would like to take a look on it. > Can you check on latest chrome and chromdriver. You can check the chromedriver version as below. Your venv should have the chromedriver binary. (pypg37) laptop207:pgadmin4 adityatoshniwal$ chromedriver --version ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}) > > Thanks ! > > > -- > *Yosry Muhammad Yosry* > > Computer Engineering student, > The Faculty of Engineering, > Cairo University (2021). > Class representative of CMP 2021. > https://www.linkedin.com/in/yosrym93/ > -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE" --000000000000c7de8f058c32ff9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Yosry,

On Tue, Jun 25, 2019 at 8:= 46 PM Yosry Muhammad <yosrym93@gma= il.com> wrote:
Hi,

=
OK. Yosry, How about sto= rin= g the=C2=A0mogirfied query in the c= ookie/session when the query is executed and then modifying query history s= toring logic to use it when called ? This way you will not need to change a= ny parsing when query history is displayed.
--

My problem is not where to s= tore the mogrified query, I can just replace the sql sent with the response= to saving the data with the mogrified one. In order to produce the mogrifi= ed query in the first place I need a psycopg2.cursor object, but I only hav= e access to a Connection object (the wrapper, not the actual psycopg2.conne= ction object). Should I modify that wrapper Connection class to add a mogir= fy function? or just get a cursor using the psycopg2.connection object like= this: conn.conn.cursor() - which doesn't seem right. Thoughts?
That would be the way. But I think web/pgadmin/util= s/driver/psycopg2/cursor.py will be corrrect place to add the mogrify function. Please note, psycopg2 does not support (,),% in the parameter na= mes. So if the column names has any of these characters, mogrify might fail= . Although it is handled with pgadmin_alias (line 493 - web/pgadmin/tools/sqleditor/__init__.p= y), please test this case as well.

Also, could you please help me with the selenium TimeoutE= xception in the feature tests? 3 tests are failing because of that exceptio= n and I am not sure what is it related to. I am attaching the feature test = log file in this email if you would like to take a look on it.
<= /div>
Can you check on latest chrome and chromdriver. You can = check the chromedriver version as below. Your venv should have the chromedr= iver binary.

(pypg37) laptop207:pgadmin= 4 adityatoshniwal$ chromedriver= =C2=A0 --version

ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd30= 0-refs/branch-heads/3770@{#40})=C2=A0

Thanks !


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


--
Adi= tya Toshniwal
Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"
--000000000000c7de8f058c32ff9b--