Main Menu      

Querious IconDatabase Relationships

When the Structure view is selected in the toolbar, and a database is selected in the primary sidebar, the Database Structure view is displayed, and by default displays the "Relationships" view.

The Database Relationships view displays all of the tables in the database in a graph representation where each table is a node, connected by edges representing foreign keys.

MySQL currently only supports foreign keys in InnoDB tables, so the foreign key edges will only be displayed for InnoDB tables that have explicity-created foreign keys.

Because Querious utilizes foreign keys to provide some very helpful features, it's would be beneficial to have the same features on MyISAM tables as well. To this end, Querious allows the creation of Artificial Foreign Keys on tables. These AFKs exist solely inside Querious and are not representative of any MySQL feature.

An artificial foreign key is created in the Database Relationships view and is intended to mimic a real foreign key with the exception of providing any real constraints in the database (such as integrity checks and delete cascading behavior, etc). The sole purpose is to document the relationships between tables and allow Querious to provide naviational features based on those relationships.

To create an Artifical Foreign Key:

  1. Select the table you want to add the AFK to in the Tables list or click on it in the graph.
  2. In the right sidebar, click on the add button and select "New Artificial Foreign Key" from the menu.
  3. Enter a unique name for the key.
  4. Choose which parent table the artificial foreign key will reference.
  5. Map the appropriate columns in the child table to the columns in the parent table.
  6. Click "Save"