Thread: Re: Query tool: Autocompletion

Re: Query tool: Autocompletion

From
"Dave Page"
Date:
Thanks, patch applied with minor tweaking re: trailing spaces as
discussed on IM, and documentation.

Regards, Dave.

> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org
> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of
> Magnus Hagander
> Sent: 08 January 2006 15:05
> To: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] Query tool: Autocompletion
>
> Dave tells me the list silently eats large mails, so here is the mail
> again without the patch. The patch is now on
> http://www.hagander.net/pgsql/patches/pgadmin_autocomplete.patch
>
> //Magnus
>
>
> > -----Original Message-----
> > From: Magnus Hagander
> > Sent: Saturday, January 07, 2006 6:33 PM
> > To: pgadmin-hackers@postgresql.org
> > Subject: Query tool: Autocompletion
> >
> > Hi!
> >
> > Attached is a first attempt at autocompletion for the SQL
> > Query tool. It probably needs some more work, but it's a start :-)
> >
> > It's based on the tab completion in psql. The idea is to pull
> > the latest and greatest tab-complete.c from psql, then run it
> > through a perlscript that picks out the tasty parts.
> >
> >
> > Anyway. Attached is the patch. I've also included a
> > tab-complete.inc from the current Due to a bug in the Visual
> > C++ compiler, it *has* to be compiled as "C" not as "C++".
> > Thus, a bit if ugly glue is required between those two worlds
> > :-)psql - to make it build directly (without adding a build
> > dependency on perl), this one is what should probably go in
> > svn, and then be manually sycned onw and then from psql.
> > "tabcomplete.c" needs to be added to the build project (I'm
> > devving in Visual Studio 2003, so I can't modify the .dsw
> > from there easily).
> >
> > I've only tested this on Windows so far. Wouldn't surprise me
> > if some minor work is needed to build on *nix.
> >
> > I'm also unsure if I can get away with the easy way I pass
> > strings in and out of wx (encoding issues?). It works in my
> > testcases, but I'm not familiar enough to be sure if it
> always does.
> >
> > Finally, I've added a screenshot for those who don't want to
> > rebuild :)
> >
> > So. Thoughts, and comments?
> >
> > //Magnus
> >
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

Re: Query tool: Autocompletion

From
Andreas Pflug
Date:
Dave Page wrote:
> Thanks, patch applied with minor tweaking re: trailing spaces as
> discussed on IM, and documentation.

I eyeballed the multibyte handling, it looks ok to me. But I found some
nasty misbehaviours:

select * from pg_c<TAB>

- On Windows, a popup will appear. If you activate a different app (e.g.
the debugger which runs pgadmin), it will stay on top. Only selecting
the very ctlSqlBox window will let it disappear (this is the usual popup
window fun...)

- On Linux, pg_cast will appear instead of the popup.

- On Linux, every <Enter> will insert two \n, i.e. an additional empty
line that can't be addressed with the cursor. This is also true if
autotabcomplete is disabled (doesn't happen when reading a script from a
file).

Regards,
Andreas

Re: Query tool: Autocompletion

From
Andreas Pflug
Date:
Dave Page wrote:
> Thanks, patch applied with minor tweaking re: trailing spaces as
> discussed on IM, and documentation.

More problems on Linux:

- select * from pg_c<Ctrl-Spc) _does_ popup the window. However, the
popup will show the same problem as on Windows, remaining on top of all
windows.

- All ctrl keys were executed twice, fixed in svn. Still, I'm not sure
if event.m_metaDown=false shouldn't be active for OSX too. It has effect
on function keys (F5 et al)

- SELECT * FROM pg_class, pg_att<Ctrl-Spc> won't do anything.
- SELECT * FROM pg_class, pg_attribute WHERE <Ctrl-Spc> will deliver
pg_attribute columns only.
- SELECT * FROM pg_class JOIN pg_attribute ON <Ctrl-Spc> won't do anything.

This renders the feature nearly useless.

Regards,
Andreas