Thread: code completion feature question

code completion feature question

From
Bartosz Dmytrak
Date:
Hi all,
there is code completion feature in pgAdmin, where can I found some doc to read about this?
It is great thing, but looks like need more development - on first sight
e.g. I can't discover how to get column names, how to accept schema selection (without using space).

thanks in advance

Regards,
Bartek

Re: code completion feature question

From
Guillaume Lelarge
Date:
On Tue, 2012-03-13 at 22:30 +0100, Bartosz Dmytrak wrote:
> Hi all,
> there is code completion feature in pgAdmin, where can I found some doc to
> read about this?

IIRC, the code completion feature comes from psql.

> It is great thing, but looks like need more development - on first sight
> e.g. I can't discover how to get column names, how to accept schema
> selection (without using space).
> 

Can you give a more precise example?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: code completion feature question

From
Bartosz Dmytrak
Date:
Hi,
lets say I would like do write something like this:

SELECT a."Col1", b."Col2"
FROM "FirstSchema"."FirstTable" a 
INNER JOIN "SecondSchema"."SecondTable" b ON (a."RowId" = b."RefRowId")
WHERE a."Col3" = NULL;

so:
what works for me (pseudo code):
SELECT
FROM <CRL + Space> list of schemas in context menu <Space to accept> then I have got:

SELECT
FROM "FirstSchema". [and space, what is not needed]

I have to delete last space to get list of tables with Ctrl + space (and again only space accepts selection)

at least:
SELECT
FROM "FirstSchema"."FirstTable" a

and there is no possibility to use code completion to insert column name a."Col1" - Ctrl + space does not work after SELECT statement.

I think good benchmark is SQL Workbench code completion feature (it is intuitive - for me, and resolves table aliases). It is possible that I missed something, because I haven't read any docs, yet.

Hope this explanation is clear enough without any attachment.


Regards,
Bartek


2012/3/13 Guillaume Lelarge <guillaume@lelarge.info>
On Tue, 2012-03-13 at 22:30 +0100, Bartosz Dmytrak wrote:
> Hi all,
> there is code completion feature in pgAdmin, where can I found some doc to
> read about this?

IIRC, the code completion feature comes from psql.

> It is great thing, but looks like need more development - on first sight
> e.g. I can't discover how to get column names, how to accept schema
> selection (without using space).
>

Can you give a more precise example?


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: code completion feature question

From
David Greco
Date:

Let me voice my agreement for this as a feature sorely missing from pgAdmin. Should be able to do full code completion of column names (aliased or not table names), function names (type schema. and functions should be available as a completion), and function paramaters (type functioname( and it displays a list of the parameters for that function).

 

 

 

From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Bartosz Dmytrak
Sent: Tuesday, March 13, 2012 5:56 PM
To: Guillaume Lelarge
Cc: PgAdmin Support
Subject: Re: [pgadmin-support] code completion feature question

 

Hi,

lets say I would like do write something like this:

 

SELECT a."Col1", b."Col2"

FROM "FirstSchema"."FirstTable" a 

INNER JOIN "SecondSchema"."SecondTable" b ON (a."RowId" = b."RefRowId")

WHERE a."Col3" = NULL;

 

so:

what works for me (pseudo code):

SELECT

FROM <CRL + Space> list of schemas in context menu <Space to accept> then I have got:

 

SELECT

FROM "FirstSchema". [and space, what is not needed]

 

I have to delete last space to get list of tables with Ctrl + space (and again only space accepts selection)

 

at least:

SELECT

FROM "FirstSchema"."FirstTable" a

 

and there is no possibility to use code completion to insert column name a."Col1" - Ctrl + space does not work after SELECT statement.

 

I think good benchmark is SQL Workbench code completion feature (it is intuitive - for me, and resolves table aliases). It is possible that I missed something, because I haven't read any docs, yet.

 

Hope this explanation is clear enough without any attachment.

 


Regards,
Bartek

2012/3/13 Guillaume Lelarge <guillaume@lelarge.info>

On Tue, 2012-03-13 at 22:30 +0100, Bartosz Dmytrak wrote:
> Hi all,
> there is code completion feature in pgAdmin, where can I found some doc to
> read about this?

IIRC, the code completion feature comes from psql.


> It is great thing, but looks like need more development - on first sight
> e.g. I can't discover how to get column names, how to accept schema
> selection (without using space).
>

Can you give a more precise example?


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

 

Re: code completion feature question

From
Dave Page
Date:
On Wed, Mar 14, 2012 at 3:04 PM, David Greco
<David_Greco@harte-hanks.com> wrote:
> Let me voice my agreement for this as a feature sorely missing from pgAdmin.
> Should be able to do full code completion of column names (aliased or not
> table names), function names (type schema. and functions should be available
> as a completion), and function paramaters (type functioname( and it displays
> a list of the parameters for that function).

As Guillaume pointed out, the code completion comes from psql. pgAdmin
uses the same source code to avoid having to maintain a separate
engine. Once psql gains the ability to autocomplete SELECT column
names (which I believe is unlikely to happen, as without knowing the
table name, even a moderately sized database could end up listing
thousands of columns), then we'll update the pgAdmin source tree with
the latest and greatest from psql.

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

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


Re: code completion feature question

From
Bartosz Dmytrak
Date:
As I wrote, SQL Workbench is good benchmark - it is not possible to select columns without named table, again, there is even possibility to filter list of available elements (tables, views, columns,...).
In my opinion GUI tool should support this feature (with or without psql background). This speeds up coding dramatically. Right now I have to copy/paste column names to avoid misspell.


Regards,
Bartek


2012/3/14 Dave Page <dpage@pgadmin.org>
... Once psql gains the ability to autocomplete SELECT column
names (which I believe is unlikely to happen, as without knowing the
table name, even a moderately sized database could end up listing
thousands of columns)

Totally agree 

Re: code completion feature question

From
Guillaume Lelarge
Date:
Le 14/03/2012 21:43, Bartosz Dmytrak a écrit :
> As I wrote, SQL Workbench is good benchmark - it is not possible to
> select columns without named table, again, there is even possibility to
> filter list of available elements (tables, views, columns,...).
> In my opinion GUI tool should support this feature (with or without psql
> background). This speeds up coding dramatically. Right now I have to
> copy/paste column names to avoid misspell.
>

If we had many developers working on pgAdmin, perhaps we would be able
to maintain our own completion feature. But we do not.

If you want a better completion feature, propose a patch for psql on the
pgsql-hackers list, and it will then be integrated in pgAdmin.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


Re: code completion feature question

From
Bartosz Dmytrak
Date:
2012/3/18 Guillaume Lelarge <guillaume@lelarge.info>
Le 14/03/2012 21:43, Bartosz Dmytrak a écrit :

As I wrote, SQL Workbench is good benchmark - it is not possible to
select columns without named table, again, there is even possibility to
filter list of available elements (tables, views, columns,...).
In my opinion GUI tool should support this feature (with or without psql
background). This speeds up coding dramatically. Right now I have to
copy/paste column names to avoid misspell.


If we had many developers working on pgAdmin, perhaps we would be able to maintain our own completion feature. But we do not.

If you want a better completion feature, propose a patch for psql on the pgsql-hackers list, and it will then be integrated in pgAdmin.


Thanks,
looks like I have to back to school (C++)


Regards,
Bartek