Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper foreign key support in the UI #192

Closed
MKleusberg opened this issue Jan 28, 2015 · 16 comments
Closed

Proper foreign key support in the UI #192

MKleusberg opened this issue Jan 28, 2015 · 16 comments

Comments

@MKleusberg
Copy link
Member

We could parse the foreign key constraints in a table definition to understand which column links to which column of a different table and then use that information in the Browse Data tab: When hovering over a cell with a foreign key constraint and some data in it, we could show a tooltip telling the user to what table is linked here. And when holding Ctrl and then clicking the cell (or some similar combination) we could jump there directly.

@justinclift
Copy link
Member

Sounds like a really good idea. Please make it so. 😁

@justinclift justinclift added the enhancement Feature requests. label Feb 15, 2015
@karai17
Copy link

karai17 commented Jun 15, 2015

Is there any update on this issue? The ability to add foreign keys would be really helpful.

@MKleusberg
Copy link
Member Author

@karai17 Adding foreign keys already is possible 😃 You have to scroll to the right side end of the grid view in the Edit/Create Table dialog but then you'll find the field you need:
foreignkey

@karai17
Copy link

karai17 commented Jun 21, 2015

....... I am an idiot. Thank you. .____.;

MKleusberg added a commit that referenced this issue Jun 21, 2015
…cell

Add a tooltip to the database browser when you hover a cell with a
foreign key set in order to show the referenced table and column.

When clicking on such a cell while holding the Ctrl and Shift key (only
one of them won't work because they are for multiselection and Alt
doesn't do the trick on my system because it's just for grabbing and
moving the window) try to jump to the table and row which is referenced
in the clicked cell.

See issue #192.
@MKleusberg
Copy link
Member Author

@karai17 No worries, you're probably not 😃 And I have to admit, too, that the field for foreign keys isn't placed very well...

As for the original issue described here: With commit 39a49e3 I try to add exactly that feature. There's a tooltip now appearing for cells with a foreign key set which tells you the name of the referenced table and when you hold Ctrl+Shift and click on the cell it jumps to the referenced row. Anyone willing to test this? 😄

@MKleusberg MKleusberg added this to the 3.8.0 - Awesome Sauce! milestone Jun 21, 2015
@SacredSkull
Copy link

It would be great if the UI itself also had a dropdown of some of the rows when entering foreign key data. phpMyAdmin and MS Access are two examples (with the latter being awful) of GUI tools that do this, but I don't think there's a single SQLite example!

Example
foreign-example

@justinclift
Copy link
Member

@MKleusberg With the latest commits, is this now fixed?

@MKleusberg
Copy link
Member Author

No, not yet. The last commits only fixed some bug I've introduced during my code refactoring. This means we're in a much better position now to start working on this but it's not yet implemented.

@justinclift
Copy link
Member

No worries. 😄

@justinclift
Copy link
Member

#614 seems related to this too.

@minaamirrizk
Copy link

@karai17 Adding foreign keys already is possible You have to scroll to the right side

OMG .. how did u get it !! .. thanks man ..

@ghost
Copy link

ghost commented Jan 4, 2019

@MKleusberg

Should it be any icon that shows that an attribute is a foreign key, like the one shown for primary key?
I don't see it now and it would be really helpful to have a proper picture of the schema.

Thank you.

mgrojo added a commit that referenced this issue Jan 12, 2019
Fields having a foreign-key constraint are shown with a distinctive icon.

New icon based on page_green.png and bullet_key.png from the Silk icon set.

See comment in issue #192
@mgrojo
Copy link
Member

mgrojo commented Jan 12, 2019

@xpidelaserra Good idea. I've added the new icon (similar to the primary key icon but with a mirrored silver key). You can try it in the next nightly build.

@MKleusberg
Copy link
Member Author

Closing this issue because

  • We have added the tooltip + follow foreign key shortcut a long time ago
  • We are showing a combobox of possible values when editing a foreign key value
  • Manuel has added the foreign key icon
  • We need to reduce the issue count 😉

@csanyipal
Copy link

Here on my Xubuntu system this does not work, as expected.
When I click on a field which has reference to another table (because it is a foreign key) the combo box is showed for a moment then immediately disappeared so I can't browse the possible values for this field, but sometimes it succeeds so I can browse the possible values for this field.

@scottfurry
Copy link
Contributor

@csanyipal - this is a closed bug. Not best practice to "bump" in this manner.
Can you start a new bug and provide as much detail as possible, please.
Crucially, we need versions for Xubuntu and DB4S where this problem was encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants