Page 1 of 1
[DONE] How does foreign key dictionary work?

Posted:
Tue Aug 21, 2012 11:16 pm
by dbster
Hi,
When you edit a column with a foreign key, a popup window shows the foreign key rows in a dictionary. That's a great feature that you should advertise! (Navicat has something similar called 'Foreign Key Data Selection')
The dictionary has 'value' (the foreign key) and 'description' columns. How does DBeaver decide which column from the referenced row to use for the description? Is it possible to select a different column for the description?
Re: How does foreign key dictionary work?

Posted:
Thu Aug 23, 2012 7:38 am
by Serge
Currently we use pretty simple algorythm to find column for description - dbeaver tries to find any column which name contains one of next strings: title, name, label, display, description, comment or remark. If no such column found then first varchar column is used.
At the moment there is no way to select different column. i'm afraid UI which allows user-defined descriptions will be too complicated and confusing.
Maybe you have any idea how it could look like?
Thanks.
Re: How does foreign key dictionary work?

Posted:
Thu Aug 23, 2012 8:17 am
by dbster
Thanks.
That's a good approach for the default column. What I don't understand is that in my DB it doesn't take the value from the first varchar column but from the second. They both don't have any of the key strings in the title. Is there maybe any additional criteria?
For user selection of a column, possibly a selection can be added to the edit dialog. Right now the dialog has three blocks: table info, value, dictionary. Now at the top of the dictionary block there is 'Dictionary: (Tablename)'. I think it wouldn't be confusing if the description column is added there, somthing like 'Dictionary: (Tablename) - Description: (Columnname)'. When you click on Columnname you could change the default description column for that table maybe using a dropdown menu.
Re: How does foreign key dictionary work?

Posted:
Thu Aug 23, 2012 8:31 am
by Serge
Ok, probably this feature will be included in next version.
Thanks for suggestion

Re: How does foreign key dictionary work?

Posted:
Thu Aug 23, 2012 12:27 pm
by dbster
That would be great!

Re: How does foreign key dictionary work?

Posted:
Sun Sep 16, 2012 8:53 am
by Serge
Disctionary descriptions edit feature added in 1.6.3.
Re: [DONE] How does foreign key dictionary work?

Posted:
Sun Sep 16, 2012 1:51 pm
by dbster
Your elegant implementation even allows the combination of several column values and the changed preference is saved across sessions.
I am impressed!
