Subject: [pgAdmin][RM4139] Drag and drop object names in Query Editor from Browser Tree

From: Aditya Toshniwal <[email-masked]>
Date: Wed, 26 Jun 2019 11:53:57 +0530

Hi Hackers,

Attached is the patch to allow tree nodes to be dragged and dropped in
query editor wherever you take the drop cursor. The drop text will be fully
qualified and double quoted if required.
For functions/procedures it will drop the the label stripping away the
parameter names, with empty pair of round brackets. It will also set the
focus cursor inside the brackets if there were params otherwiser to the end
of text.
For adding a node type, you need to register it in browser.js along with a
callback function which will return drop text along with cursor positioning
and selection. Currently, I have registered for "table partition type
sequence package view mview foreign_table edbvar schema column edbfunc
function edbproc procedure".

Please note, the drag design customisation is not supported in IE.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

---

From: Dave Page <[email-masked]>
Date: Wed, 26 Jun 2019 07:21:29 -0400

Hi

> Please note, the drag design customisation is not supported in IE.

I think for functions/procedures, we should include placeholders for the
parameters, so the user has a hint about what they need to fill in to
complete the call.

Also; shouldn't there be a doc update?

Thanks.

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

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

---

From: Aditya Toshniwal <[email-masked]>
Date: Wed, 26 Jun 2019 16:58:13 +0530

Hi,

On Wed, Jun 26, 2019 at 4:51 PM Dave Page <[email-masked]> wrote:

>> For adding a node type, you need to register it in browser.js along with
>> a callback function which will return drop text along with cursor
>> positioning and selection. Currently, I have registered for "table
>> partition type sequence package view mview foreign_table edbvar schema
>> column edbfunc function edbproc procedure".
>>
I can fill in the parameter names same as tree node, with cursor selection
on all the params ?

> Also; shouldn't there be a doc update?
Yeah :/
Should there be any screenshots ?

---

From: Dave Page <[email-masked]>
Date: Wed, 26 Jun 2019 07:36:06 -0400

> I can fill in the parameter names same as tree node, with cursor selection

Can you select the first one, and put the cursor in front of it?

> Should there be any screenshots ?

I don't see much need.

Thanks.

---

From: Aditya Toshniwal <[email-masked]>
Date: Wed, 26 Jun 2019 17:08:12 +0530

Hi,

On Wed, Jun 26, 2019 at 5:06 PM Dave Page <[email-masked]> wrote:

>>>> For adding a node type, you need to register it in browser.js along
>>>> with a callback function which will return drop text along with cursor
>> I can fill in the parameter names same as tree node, with cursor
>> selection on all the params ?
>>
>
Yes. Will do that. So that, just after drop if the user types anything it
will replace the first param name.

>> Should there be any screenshots ?
Cool.

---

From: Dave Page <[email-masked]>
Date: Wed, 26 Jun 2019 07:39:21 -0400

On Wed, Jun 26, 2019 at 7:38 AM Aditya Toshniwal <
[email-masked]> wrote:

>>>> I think for functions/procedures, we should include placeholders for
>>>> the parameters, so the user has a hint about what they need to fill in to
>>>> complete the call.
>>>>

Right.

>>> Should there be any screenshots ?

:-)

---

From: Aditya Toshniwal <[email-masked]>
Date: Thu, 27 Jun 2019 16:01:51 +0530

Hi Hackers,

Attached is the updated patch based on the review comments in trailing mail.
Kindly review.

On Wed, Jun 26, 2019 at 5:09 PM Dave Page <[email-masked]> wrote:

>>>>>> Attached is the patch to allow tree nodes to be dragged and dropped
>>>>>> in query editor wherever you take the drop cursor. The drop text will be
>>>>>> fully qualified and double quoted if required.
>>>>>> For functions/procedures it will drop the the label stripping away
>>>>>> the parameter names, with empty pair of round brackets. It will also set
>>>>>> the focus cursor inside the brackets if there were params otherwiser to the
>>>>>> end of text.

---

From: Dave Page <[email-masked]>
Date: Thu, 27 Jun 2019 10:30:39 -0400

Thanks, applied.

On Thu, Jun 27, 2019 at 6:32 AM Aditya Toshniwal <
[email-masked]> wrote:

>>> Yes. Will do that. So that, just after drop if the user types anything
>>> it will replace the first param name.
>>>
>>
>> Right.
>>
>>
>>>
>>>>
>>>>>