Skip site navigation (1) Skip section navigation (2)

SQL Macros in QueryTool.

From: Krzysztof Śmigrodzki <ksmigrod(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SQL Macros in QueryTool.
Date: 2007-06-26 08:54:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers
I've been asked to add little macro capabilities to PgAdmin's QueryTool.

My plans:

Every macro has:
- key shortcut (key),
- short descriptive title (title),
- query text (query).

Just right of Favourites menu, I'll add
Macros menu with
- Macros Setup dialog,
- Separator
for macro in macros:
     macro.title + "\t" + macro.key

Macros will be stored, and added to menu just like Favourites. wxMenu 
description key handler will generate command event, on key shortcut hit.

In frmQuery class I'll add next EVT_MENU_RANGE to event table.
I'll create method which:
1. retrieve query from queryMacroList (think of queryFavoritesFolder 
without support for sublevels), based on event.GetId().
2. replace $SELECTED$ placeholder with current selection (if there is 
placeholder in query, and there is selection in editor)
3. run query (mimic OnExecute behaviour).

I'll start with implementing actual macro capabilities without 
configuration dialog (tester will edit xml file to add new macros). This 
part will be ready in two weeks time (I'm coding that in spare time).

Then I'll create configuration dialog. I've got some doubts how to 
implement so expect question on the list.

If that will work, I think of defining different macro sets for 
different server/databases (default macros for application, but they can 
be overridden by macros specific to server or database).

My development platform is:
- Windows Vista Bussines x64, Polish
- VC++ 2005 Express
- wxWidgets 2.8.4 (current stable release)
- PostgreSQL 8.2.4, default package from OpenBSD, run on virtual machine.
I'll start with revision 6393 of PGAdmin code. I'll build 32 bit code 
(don't know if PGAdmin work in Windows 64 bit environment).

Regards, Krzysiek


pgadmin-hackers by date

Next:From: Dave PageDate: 2007-06-26 09:27:50
Subject: Re: SQL Macros in QueryTool.
Previous:From: Dave PageDate: 2007-06-26 07:27:26
Subject: Re: Time for feature freeze

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group