Re: [GSoC][Patch] Automatic Mode Detection V1

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Yosry Muhammad <yosrym93(at)gmail(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [GSoC][Patch] Automatic Mode Detection V1
Date: 2019-06-26 09:46:04
Message-ID: CAM9w-_=2GMSPnJPK=sfbDgO_jXoEFf4Q6SVodZrvNeMVNRkpPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi,

On Wed, Jun 26, 2019 at 10:35 AM Aditya Toshniwal <
aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:

> Hi Yosry,
>
> On Tue, Jun 25, 2019 at 8:46 PM Yosry Muhammad <yosrym93(at)gmail(dot)com> 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(at){#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"

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2019-06-26 11:01:40 Re: [GSoC][Patch] Automatic Mode Detection V1
Previous Message Khushboo Vashi 2019-06-26 09:11:13 Re: Getting Involved