From: | "J(dot)F(dot) Oster" <jinfroster(at)mail(dot)ru> |
---|---|
To: | pgadmin-hackers(at)postgresql(dot)org |
Subject: | PATCH: new feature for Query tool: Favourites injection |
Date: | 2014-07-09 16:24:56 |
Message-ID: | 1771227321.20140709202456@mail.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
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.
Attachment | Content-Type | Size |
---|---|---|
140709_favourites_injection_and_proposed_filename.patch | application/octet-stream | 6.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume Lelarge | 2014-07-09 21:51:04 | pgAdmin III commit: Fix generated DDL for views |
Previous Message | J.F. Oster | 2014-07-09 15:08:44 | Re: pgAdmin III commit: Support the new check_option parameter of views |