Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Foreign Key Moving To

forums forums SQLyog SQLyog: Bugs / Feature Requests Foreign Key Moving To

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #13317
      avil
      Member

      Good feature is to show foreign key-field as clickable link in quer result or table-result view. When we click on it then we open related record inside related table.

    • #35202
      peterlaursen
      Participant

      It is there. Click twice on a cell where a FK constrant applies and an “…” button will appear. Please see image.

       

      [attachment=2011:fklookup.jpg]

       

       

       

       

      Release notes of SQLyog 9.0 (April 2011):

      Features:

      — Added an option (in GRID and FORM view) to look up/search valid values for columns having Foreign Key CONSTRAINTS.

       

       

       

    • #35203
      dinfinity
      Member

      It is not there. At least, not in the way avil meant.

       

      The current foreign key feature is already extremely useful, especially if you use UUID based primary keys.

      The suggested foreign key feature is to be able to continue the process and thus ‘navigate’ through the database.

       

      Suppose a database schema with a Document referencing a User referencing an Organisation referencing an Address.

      With the current feature, you cannot go from Document to Address without copy-pasting the intermediate foreign keys in some filter. It only works for inspecting records that are one step away.

      With the suggested feature, one would be able to open the referenced table (with filter enabled) in a view in which you can consequently open other FK references and continue the process indefinitely.

       

      I do believe the original implementation should also be accessible, as it is useful for assigning a value (and I don’t see how such functionality could be implemented naturally if the result is shown in a separate table data view or in the query result view).

    • #35204
      peterlaursen
      Participant

      OK, but what should the implemenation be like exactly? 

       

      We can only have one non-persistent DATA tab (a non-persistent DATA tab is the one the shows the latest table selected in Object browser). However we have an option for persistent DATA tabs as well.  So  think it would be possible to open the parent table in such (from context menu, for instance in order not to waste space in the GRID). The actual row may then be preselected/highlighted here. 

       

      However you may not have considered that there could be more than one row in parent table that is the parent. MySQL allows a for many-to-may relationships with a non-unique index on parent column.  In that case there is not (or may not be) one specific row on target that can be consisered the parent row.  All rows with same value in target would be equally much parents here. Any idea how to handle this? 

       

      Maybe also you can tell exactly how you would use such feature and why?

Viewing 3 reply threads
  • You must be logged in to reply to this topic.