SqlEditor title

View: New views
4 Messages — Rating Filter:   Alert me  

SqlEditor title

by Milan Babuskov-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Some time ago I decided to experiment with 'smart' titles for SQL
editor. I'm guess I'm probably not the only one who doesn't like
having 5+ windows titled SET TERM at a time.

In first version, I extracted the first statement, so title would be
something like "SELECT column_list FROM t1" or "ALTER TABLE t1" or
"EXECUTE PROCEDURE p1".

However, these turn out to be to long and too common for the taskbar
(having 5 "ALTER PROCEDURE"s is not much better than 5 "SET TERM"s).
So, I decided to make it shorter, showing just the action and object
name like "SELECT t1", "ALTER t1", "EXECUTE p1".

Nice, but I still got the same SELECT/INSERT/UPDATE/EXECUTE/ALTER
repeating all the time, and since they are 'left' they are shown
entirely, while the more interesting thing, object name, usually does
not fit. So, I first shortened it, like this: "SEL t1", "ALT t1",
"EXEC p1".

In the end, I made it even shorter, using these abbreviations:

c    create
a    alter
x    execute
s     select
i     insert
u     update
del    delete
decl  declare  (dcl is too similar to del)
drop   drop    I believe DROP is significant enough to be shown entirely :)
grnt    grant
recr     recreate
rev      revoke

I tried to use FR like that for some short time, and it's really good
once you get used to it. I committed this version to the SVN so others
can test.

I'm just not sure whether these very short abbreviations can be
confusing, and maybe we should use the longer (3 letter) strings?

Any opinions or ideas are welcome?

--
Milan Babuskov
http://www.flamerobin.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flamerobin-devel mailing list
Flamerobin-devel@...
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel

Re: SqlEditor title

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 11:32 PM, Milan Babuskov
<milan.babuskov@...> wrote:
> decl  declare  (dcl is too similar to del)

This associates me the "cdecl" calling convention. :) But makes sense.

> I'm just not sure whether these very short abbreviations can be
> confusing, and maybe we should use the longer (3 letter) strings?

I vote for at least 2 characters abbreviation.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flamerobin-devel mailing list
Flamerobin-devel@...
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel

Re: SqlEditor title

by Michael Hieke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Milan,

I'm not that keen on the single-letter abbreviations, but stuff like

   insert into foo
   delete from bar
   declare baz

would certainly be better than what FR has now.

But the thing I could use the most would be a special comment format
which is detected at the beginning of the SQL editor text, and when
found is used for the title of the frame.  Kind of like embedded
documentation tags for programming languages (javadoc and the like).

When I'm for example experimenting with JOINs, then all my statements
might start with

   select foo1, ... from bar
     join ...

so I could simply add a small comment at the start to identify the stuff
I'm testing out.

Similarly for scripts: First line will always be a line with the
Subversion ID string, but the next comment could then be something like

   /*@FR-TITLE@ Update script #42 for foo database */

which would then show

   SQL Editor - Update script #42 for foo database

as the title of the editor frame.
But this is only in addition to your proposal.

Thanks

--
Michael Hieke


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flamerobin-devel mailing list
Flamerobin-devel@...
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel

Re: SqlEditor title

by Milan Babuskov-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 24, 2008 at 8:38 AM, Michael Hieke <mghie@...> wrote:
> I'm not that keen on the single-letter abbreviations, but stuff like
>
>   insert into foo
>   delete from bar
>   declare baz
>
> would certainly be better than what FR has now.

I believe this one calls for a configuration option. It can be in "SQL
Editor" section, like this:

SQL keywords in window title:
(o) full (ex. insert into foo)
( ) short (ex. ins foo)
( ) really short (ex. i foo)

Maybe the wording could be better. Ideas?


I learned that many people currently add comments at start of script

-- my script

and current tokenizer would skip that, so I'd add one more option:

[x] Use comment on first line when available


>   /*@FR-TITLE@ Update script #42 for foo database */
> But this is only in addition to your proposal.

Good idea. I'll add support for this one.


I'm also thinking that for larger scripts (say 10+ kB), the default
title would instead say something like "46kB script" since it is
probably not a single statement. This would work only when @FR-TITLE@
is not present.


Thanks,

--
Milan Babuskov
http://www.flamerobin.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flamerobin-devel mailing list
Flamerobin-devel@...
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel