automatically getting a "frame" of a select-statement

nobswolf posted 3 years ago in Feature discussion
In the Mysql Workbench I used before Heidi you get a complete default-select-statement with a right click on the table name and choosing "select rows" like

SELECT * FROM dummy.test;

This way you have a "starting point" which saves a lot of typing when you debugging schemas a lot. The phpmyadmin does similar.

Is this feature available in Heidi as well?
ansgar posted 3 years ago
In the very right box inside a query tab you see the selected table's "Columns in [table]". Expanding that enables you to select one or more columns, then a rightclick offers "Generate INSERT", "Generate UPDATE" and "Generate DELETE". Unfortunately, "Generate SELECT is missing heresmileThink it's a good idea to add SELECT to that menu.
nobswolf posted 3 years ago
ah, and I found the snippets there...

It would be nice to have "automagic" replacement-variables to put the "currently active table" there. So I could add to snippets something like:

select $curAllCols
from $curTable
ansgar posted 3 years ago
As long as you only refer to this use case I prefer to add that above mentioned "Generate SELECT" menu item. If such a template logic per snippets would be more useful than that I will go and do what you suggest here.
nobswolf posted 3 years ago
Thats a good question...

I'd say if there are more possible variables, then you could refactor the whole menu-structure there and make most of the entries a "snippet". So you get the details of the SQL out of your code, which is a good thing, IMHO.

But if the example above is the only thing that could be done with variables it might be a bit of overkill to code a parser for such variables.

I am a bit "locked on target" right now to give a good advise. Maybe other users have an opinion on this topic?
ansgar posted 3 years ago
Well, a new menu item besides the three other ones should be very simple to add, so that's definitely the first thing I'll do.
ansgar posted 3 years ago
Done in r4477
jfalch posted 3 years ago
thanks; but i´m a bit confused right now. what do i have to do to see the "Generate SELECT" menu item ?
ansgar posted 3 years ago
Rightclick one or more column names, in the very right box of any query tab, after expanding "Column in [selected table]"
Plasm posted 3 years ago
A bit cosmetic:
Generate SELECT...
INSERT generieren...
UPDATE generieren...
DELETE generieren...

"SELECT generieren..." would fit better.
This issue probably exists only in the german translation(?)
ansgar posted 3 years ago
Ah yes... again I forgot to take translations into account. Thanks for the hint.

Please login to leave a reply, or register at first.