[DONE] How does foreign key dictionary work?

Note: please leave bug reports and feature requests on

[DONE] How does foreign key dictionary work?

Postby dbster » Tue Aug 21, 2012 11:16 pm

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?
dbster
 
Posts: 10
Joined: Mon Aug 20, 2012 11:41 pm

Re: How does foreign key dictionary work?

Postby Serge » Thu Aug 23, 2012 7:38 am

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.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: How does foreign key dictionary work?

Postby dbster » Thu Aug 23, 2012 8:17 am

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.
dbster
 
Posts: 10
Joined: Mon Aug 20, 2012 11:41 pm

Re: How does foreign key dictionary work?

Postby Serge » Thu Aug 23, 2012 8:31 am

Ok, probably this feature will be included in next version.
Thanks for suggestion :)
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: How does foreign key dictionary work?

Postby dbster » Thu Aug 23, 2012 12:27 pm

That would be great! :)
dbster
 
Posts: 10
Joined: Mon Aug 20, 2012 11:41 pm

Re: How does foreign key dictionary work?

Postby Serge » Sun Sep 16, 2012 8:53 am

Disctionary descriptions edit feature added in 1.6.3.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: [DONE] How does foreign key dictionary work?

Postby dbster » Sun Sep 16, 2012 1:51 pm

Your elegant implementation even allows the combination of several column values and the changed preference is saved across sessions.

I am impressed! :D
dbster
 
Posts: 10
Joined: Mon Aug 20, 2012 11:41 pm


Return to Support



Who is online

Users browsing this forum: No registered users and 11 guests