Re: PATCH: new feature for Query tool: Favourites injection

From: Dave Page <dpage(at)pgadmin(dot)org>
To: "J(dot)F(dot) Oster" <jinfroster(at)mail(dot)ru>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: new feature for Query tool: Favourites injection
Date: 2014-07-16 08:08:41
Message-ID: CA+OCxozhOwLG3S+n=r0T=C7tPuoTmkbbP8wkmsSAdy0TUg2ouQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Ashesh, can you review/commit this too please?

On Wed, Jul 9, 2014 at 5:24 PM, J.F. Oster <jinfroster(at)mail(dot)ru> wrote:

> Hello!
>
> When writing ad hoc queries or plpgsql code it is often handy to
> operate with small text snippets as the building blocks.
> PgAdmin has no Templates feature, but Favourites is very close to it.
> What is missing - the ability to quickly apply (inject) some snippet
> in the cursor position, preferably without touching the mouse.
>
> Suggested implementation allows to type desired favourite's name right
> into the text area and press a hotkey (I think it should be F2 or some
> other single button - for speed). The word under cursor gets searched
> among favourite's names and if found - is replaced with favourite's
> contents. Cursor gets positioned after it, and we are ready to type
> further.
> For expample, if I have to write some typical query like:
> SELECT COUNT(*) FROM table1
> WHERE column1 IS DISTINCT FROM 100;
> Using my Favourites I have to type just:
> scf<F2>table1
> w<F2>column1 idf<F2>100;
>
> Also if I often address ad hoc queries to some specific tables with
> long names, I can make templates for them:
> sfbcah<F2> = SELECT * FROM billing.client_attr_hist
> And so on.
>
> For convenience all these quick and short favourites can be stored in
> a separate subfolder.
> After some preparation and training one can make his everyday SQL
> typing much more pleasant :)
>
>
> Also this patch adds a "proposed" file name for queries whose origin
> is INITIAL. Query texts passed to the constructor are always based on
> some object (DDL, SELECT, INSERT on it and so on). If the user chooses
> to save such a query, the filename probably will contain object's
> name. Well, if not - the user will type in his own name with same
> number of keystrokes. In my experience it works just fine in many
> cases, for example, saving DDLs to SVN.
>
>
> --
> Best regards,
> J.F.
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>

--
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 Ashesh Vashi 2014-07-16 08:42:12 Re: PATCH: new feature for Query tool: Favourites injection
Previous Message Dave Page 2014-07-16 08:08:03 Re: PATCH: saving macro after query pasting