Re: Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com>
Cc: Joao Pedro De Almeida Pereira <jdealmeidapereira(at)pivotal(dot)io>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]
Date: 2017-05-16 14:44:39
Message-ID: CA+OCxozQj0gy7dsorij5fXSgLuhGDJP7uC4++VviAPR1XFs-Fw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Mon, May 15, 2017 at 7:40 PM, Harshal Dhumal <
harshal(dot)dhumal(at)enterprisedb(dot)com> wrote:

> Hi,
>
> On Sat, May 13, 2017 at 12:35 AM, Joao Pedro De Almeida Pereira <
> jdealmeidapereira(at)pivotal(dot)io> wrote:
>
>> We were only able to apply the patch on 1f903ba2 (were seeing patch does
>> not apply due to sqleditor.js conflicts)
>> The javascript tests passed, but we were unable to copy rows or columns
>> or cells when running the application. Could you run feature tests?
>>
> There are three modes sqleditor can be launched
> 1. Query tool (Tools menus -> Query Tool)
> 2. Datagrid. (Right click on any table/view -> View Data -> View
> All/First 100/Last 100/Filtered rows)
> 3. Scripts (Right click on any table/view -> INSERT/CREATE/UPDATE/DELETE/
> SELECT)
>
> Paste functionality is only enabled in Datagrid and table has Primary key
> otherwise it's disabled. In your case row might have been copied but you
> were unable paste because you might be trying to paste the rows in Query
> tool. Please try again in Datagrid with table having Primary key.
>
>
>>
>> Now that more functionality is being added to sqleditor.js, this may be a
>> good time to extract the functionality to separate files. This will
>> increase readability, and encourage separation of concerns. It will also
>> make changes easier to test in isolation.
>>
> Ok. Let me check if I can separate out ant functionalities.
>
>
>> It's probably a good idea to test the changes made to the python as well
>> as javascript code. In this case, the new behavior of poll() in sqleditor
>> __init__ should be tested.
>>
>
> At this point we don't have any python unit tests that can test sqleditor
> backend (python code).
> @Dave should I include python unit test cases in this patch?
>

We do have some feature tests that hit the query tool - Murtuza wrote some
anti-XSS validation tests for example, and Khushboo has been working on
some datatype rendering tests.

As a general rule, I prefer we focus more on feature tests now than the API
tests - they cover the whole app end-to-end of course. The disadvantages
are:

- The treeview isn't reliable enough for me to enable those tests on the CI
server yet.

- They can take a long time to run, so we need to test multiple things at
once wherever possible. That means minimising browser reloads, or new
instances of tools like the Query Tool - or even the number of queries
executed through the query tool as part of a test.

That said, yes, if there are specific things that are not covered by
Murtuza and Khushboo's work, we should test them. For example, loading all
rows when the user selects all, running/rendering EXPLAIN, auto-commit vs.
auto-rollback (and combinations thereof).

The standard moving forwards should be to include feature tests for new
functionality and Jasmine tests for algorithmic JS code.

I also agree with Joao on the modularisation of JS code. Testable and
reusable code should be in "library" files, and we should work to minimise
the amount of JS templates - for the most part, that means moving to the
client-side translation mechanism which Tira worked on, and I've done some
early migration work.

Thanks.

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

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2017-05-16 15:43:09 [pgAdmin4][PATCH] To fix the issue in server stats sql (PPAS9.2)
Previous Message Joao Pedro De Almeida Pereira 2017-05-16 13:37:23 Re: [pgAdmin4][PATCH] To fix the issue with Node rename