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 1hg4Vt-0001lO-ET for pgadmin-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 09:46:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hg4Vr-0002ma-5x for pgadmin-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 09:46:47 +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 1hg4Vq-0002mT-N1 for pgadmin-hackers@lists.postgresql.org; Wed, 26 Jun 2019 09:46:46 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hg4Vn-00088G-Bi for pgadmin-hackers@postgresql.org; Wed, 26 Jun 2019 09:46:44 +0000 Received: by mail-lf1-x12e.google.com with SMTP id x144so1105736lfa.9 for ; Wed, 26 Jun 2019 02:46:42 -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=EtEfuwo5K0k51xIYTEECK0TLvy+XZHOb/IBrBpQke88=; b=qejeBQAWQ4ISt5jEkQKv+Pa4VAX+gXuMBhWJh8fOJ+2XrMGXNE2mn4upl2lvKCj9Rf iRmjNrXC1Wde9EX2SpTumwjqvKwuYvYhdCPT4P0pY19JByU8sKfhe4ixgRhpbS+OLvrw Kad3LnJRkCBDcW9NmPtWKFjF3XR/WTbrFgHyUVd0X4mH7pkzNYsHxfq9JWxJ7xSuLKNA tDvR/ub8tbOl8IXQWb44wB7DSW88KFY+cyCz/FcfGTSifUr971LeBhRnmbYV6MqPyptC T/LrRW7ZUoMcB7gkVwcG1cILgGDv2kt6tJRgSbI2x9yurRdaE/FEV2x+K8IPXxGmah6W n9mw== 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=EtEfuwo5K0k51xIYTEECK0TLvy+XZHOb/IBrBpQke88=; b=sOxA7swDGs54PTWKHWHblE87wCwQ/jdPR0/8Er/CqFCj+50A30PzipAG3/6Z6Y/CaR sx0QP7o9ePS6Kwe9yJA4mt6URwsOShgNKxbS6jcNAuGOsiGnDzinwI58voOOEFCZVg9X s/zEAA4j2PCZ3ytcCn7RJHfJxAFXnS3qyWqpd9SCvEuWw94EnB0yALiPDg+mkFxkHjC2 4K3Vs2WpDEAhQRQYnWuifTJmMYbUYMEQ7DuJ/UJQ3YYj2i6/rZLY5R1ouYTBaKYEXyBa QUNz8uONbq63sIq4Nto5yHQZohykXvtCZVy0QUYoFuOQPqGtT6B9ff+GyXNuFpb6S2cg TVCQ== X-Gm-Message-State: APjAAAUlUid+zs6BlOWBqnWqmH1pNhFRtVMDc/SJyHy1qZsZVUDgmL2+ LFyAZ6t6SCs5/AWpnYWVtQWV8EQsfSXatEUsghYKnjpL3f0= X-Google-Smtp-Source: APXvYqzkXHm/lqbF8wlWiFSuILXmgINgaw8LKFnNSOXH45CNNsHSIZH+eRLgzpe4CWSfYIKzryus35bzkc01dIFknJg= X-Received: by 2002:a19:c14f:: with SMTP id r76mr2266438lff.70.1561542400645; Wed, 26 Jun 2019 02:46:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Wed, 26 Jun 2019 15:16:04 +0530 Message-ID: Subject: Re: [GSoC][Patch] Automatic Mode Detection V1 To: Yosry Muhammad Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000017b6e6058c36eca3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000017b6e6058c36eca3 Content-Type: text/plain; charset="UTF-8" Hi, On Wed, Jun 26, 2019 at 10:35 AM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > 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. > You can also get the last executed SQL in psycopg2 - http://initd.org/psycopg/docs/cursor.html#cursor.query. May be this can be used. > >> 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" > -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE" --00000000000017b6e6058c36eca3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

=
On Wed, Jun 26, 2019 at 10:35 AM Adit= ya Toshniwal <adity= a.toshniwal@enterprisedb.com> wrote:
Hi=C2=A0Yosry,

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


<= div>= OK. Yosry, How about storing the=C2=A0mogirfied query in the cookie/session when the query is executed and then m= odifying query history storing logic to use it when called ? This way you w= ill not need to change any parsing when query history is displayed.<= /font>
--

My p= roblem is not where to store the mogrified query, I can just replace the sq= l sent with the response to saving the data with the mogrified one. In orde= r to produce the mogrified query in the first place I need a psycopg2.curso= r object, but I only have access to a Connection object (the wrapper, not t= he actual psycopg2.connection object). Should I modify that wrapper Connect= ion class to add a mogirfy function? or just get a cursor using the psycopg= 2.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 charac= ters, mogrify might fail. Although it is handled with pgadmin_alias (line 493 - web/pgadmin/tools/sqleditor/__init__= .py), please test this case as well.
You can also get the last executed SQL in psycopg2 -=C2=A0http://init= d.org/psycopg/docs/cursor.html#cursor.query. May be this can be used.
<= div class=3D"gmail_quote">

Also, coul= d you please help me with the selenium TimeoutException in the feature test= s? 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 yo= u would like to take a look on it.
Can you c= heck on latest chrome and chromdriver. You can check the chromedriver versi= on as below. Your venv should have the chromedriver binary.

(pypg37) laptop207:pgadmin4 adityatoshniwal$ ch= romedriver=C2=A0 --version

C= hromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/bran= ch-heads/3770@{#40})=C2=A0

Thanks !


--
Yosry Muhammad Yosry

Computer Engi= neering student,
The Faculty of Engine= ering,
Cairo University (2021).
Class representative of CMP 2021.
https://www.linkedin.com/in/yosrym93/


--
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB I= ndia |=C2=A0Pune
"Don't Complain about Heat, Plant a TREE"


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