Relationship diagram

The Relationship diagram shows your Warehouse tables as boxes on a canvas and their relationships as lines. Use it to see how tables connect, arrange them into layouts, and create, change or remove relationships.

Open the diagram

  1. Open Warehouse from the sidebar.
  2. Click Relationship Diagram in the header on the right.

If the Warehouse has no tables, the area shows "No tables available". While the diagram loads, it shows Loading diagram.

The layouts panel runs down the left side. Its header reads LAYOUTS PANEL; Hide panel collapses it, and Show layouts panel brings it back. The tab list sits at the top of the panel and the Logical Models list below it; drag the divider between the two parts to change the split. The diagram opens on the Warehouse Diagram tab.

The same tool for Lake tables is described in Relationship diagram.

Filter by logical model

The Logical Models list in the layouts panel shows one row per logical model with the number of tables that use it, most tables first.

Logical models covers the models themselves.

Add tables to a layout

Tables go onto a custom layout. You can't drag tables onto the Warehouse Diagram tab.

  1. Click New Layout at the bottom of the tab list, type a name in New Layout Name, and click Continue or press Enter.
  2. Drag a table from the Warehouse tree onto the canvas. The canvas highlights while you drag, and the diagram confirms with Table added successfully.

If the table is already in the layout, the diagram moves to it and shows "Table already exists in this layout". Adding a table while a logical model is selected clears the model filter so the table is visible. If a drop is refused, the diagram shows "Failed to add table".

To add the tables linked to one table, click that table on the canvas and click Related Tables in its tools. If there is nothing to add, the diagram shows "No related tables found", or "All related tables are already on the diagram" when every linked table is already there.

To rename, duplicate or remove a custom layout, right-click its tab and choose Rename, Duplicate or Remove; Duplicate is also Alt+Shift+D. Removing a layout opens the Are you sure? dialog, which says "This action will permanently delete this custom diagram layout. This action cannot be undone."; click Delete. Custom tabs show how many tables the layout holds.

Your layouts and the table positions on them are saved, so they come back on your next visit.

Work with a table on the canvas

Click a table to show its tools, or double-click a table to open it. A table node lists up to ten fields, with the fields used in relationships and the primary key first; Show more reveals the rest and Show less folds them again.

Remove from Layout and Related Tables appear only on custom layouts. In the built-in Warehouse Diagram, only Edit table is available. The table tools appear only on a desktop-width screen.

Arrange tables

  1. Click Auto Layout in the canvas toolbar.
  2. Under Layouts, choose Star, Compact (the default), Horizontal or Spacious.
  3. Under Unconnected, choose Below or Side for tables without relationships.

The tables move, and the diagram shows Layout Applied, naming the preset it used. A reorder that runs without a chosen preset asks first: Reorder Diagram shows "Are you sure you want to reorder the diagram?". Choose Reorder to continue, or Cancel to stop.

Find your way around the canvas

Undo and redo

Undo and Redo sit in the canvas toolbar; each is greyed out when there is nothing to undo or redo. Use them to step back and forward through canvas changes, such as moving tables and creating or removing relationships.

The history lasts only for this visit: it is empty after you reload the page, and Refresh from Database clears it.

Create a relationship

You can create a relationship by dragging or in the Create Relationship dialog.

Drag between two columns

  1. Hover over the row of the column you want to link; handles appear on the row.
  2. Drag from a handle to the column you want to link to. A dashed line follows the pointer and snaps to a column when it is close.
  3. Release over the target column.

The relationship is created as One to Many, with the field you dragged from as the primary side, and the diagram shows "Relationship created" with "Table reference and relationship created successfully". Change the cardinality afterwards in Set Relationship Type.

In the Warehouse diagram, a drag between two different columns of one table is allowed; a column can never reference itself.

Use the Create Relationship dialog

  1. Right-click an empty area of the canvas and choose New relationship. On a desktop-width screen, you can also press Alt+N while the diagram has focus.
  2. In Create Relationship, choose the Primary Table and its Primary Field.
  3. Choose the Referenced Table and its Referenced Field.
  4. Choose a Cardinality. The dialog opens on One to One every time.
  5. Click Create. When the save finishes, the new line appears selected on the canvas and the view fits both tables on screen.

Each field choice shows the field's type in brackets. Create stays unavailable until all four choices are made and the two fields have the same type.

CardinalityShown asWhat it means
One to One1:1One row of the primary table matches one row of the referenced table.
One to Many1:*One row of the primary table matches many rows of the referenced table.
Many to One*:1Many rows of the primary table match one row of the referenced table.

Many-to-many relationships are not offered. To model one, use a junction table between the two tables.

Change or remove a relationship

Click a relationship line to select it. Its tools show an edit button and a delete button.

To change the cardinality:

  1. Double-click the line, or click the edit button (its tooltip reads Edit relationship). The dialog opens on the relationship's current type.
  2. In Set Relationship Type, choose One to One, One to Many or Many to One.
  3. Click Confirm. The change is saved when you confirm.

To remove a relationship:

  1. Click the delete button (its tooltip reads Delete relationship).
  2. In Remove Relationship, click Remove. The diagram shows "Relationship Removed".
Note

Removing a relationship deletes it. Confirm Remove only when you are sure.

Refresh the diagram

The diagram keeps a copy of its data in your browser for 18 hours. The Last Cached line in the layouts panel header shows how old that copy is, for example "just now", "20 minutes ago" or "2 days ago"; with nothing stored yet it reads Last Cached -, and while a refresh runs it reads Refreshing….

To load the latest tables before the copy ages out, click Refresh from Database in the canvas toolbar, or Refresh diagram data in the layouts panel or its Logical Models list. While it runs, the button is disabled and the diagram shows Refreshing diagram. When it finishes, it shows Diagram refreshed. If the refresh fails, it shows Refresh failed, or Refresh step failed for a single failed step; if the local copy cannot be cleared, it shows Failed to clear local diagram cache and the refresh continues.

The diagram also refreshes the copy on its own, silently, when the copy is more than two days old.

Deployment status on a table

A table that is not deployed yet shows To be deployed on its diagram node. Deploy it from the table's popup, as described in Deploy, run, truncate and monitor tables; a deployed table has no banner. View tables appear on the diagram once they are deployed.

Who can do what

What you want to doPermission
See the diagramView Warehouse Objects
Create, change or remove a relationshipAdd/Modify Warehouse Objects

Without the permission, the buttons still appear. The change is refused with an access denied message. See Warehouse permissions and row-level security.

Limits and edge cases

Questions, answered

Why can't I connect two columns?

The two columns have different data types. The Create Relationship dialog accepts only fields of the same type, so choose two fields with the same type.

Why do I see only some of my tables when the diagram opens?

The diagram selects one logical model when it opens, the one with the most tables, so you see that model's tables only. Choose another model in the Logical Models list to switch the view; on a custom layout you can also choose All Logical Models.

Why is a table I just created missing from the diagram?

The diagram keeps a copy of its data for 18 hours. Click Refresh diagram data in the layouts panel to load the latest tables from the server.

Does Remove from Layout delete the table?

No. It removes the table from that layout only. The table stays in the Warehouse and on any other layout where it appears.

Why don't I see Remove from Layout or Related Tables?

Those two buttons appear only on a custom layout. Click New Layout, add the table to it, and select the table there. They also need a desktop-width screen.

Why does a table show To be deployed?

The table is not deployed yet. Deploy it from the table's popup; see Deploy, run, truncate and monitor tables.

Can I tidy the diagram automatically?

Yes. Click Auto Layout in the toolbar and choose Star, Compact, Horizontal or Spacious. If you don't like the result, click Undo.

Can I undo a change in the Warehouse diagram?

Yes. Click Undo in the toolbar to step back, and Redo to step forward again. Refreshing from the database clears this history.

Can a column reference another column in the same table?

Yes. Drag from one column to a different column in the same table. A column can't reference itself.

Why do I get an access denied message when I change a relationship?

Creating, changing or removing a relationship needs Add/Modify Warehouse Objects. Ask your administrator to give your role that permission.