Relationship diagram

The relationship diagram shows the Lake tables of one datasource on a canvas. Use it to arrange tables in layouts, spot tables that are not ready yet, and link a field of one table to a field of another.

Open the diagram

  1. Open Lake > Relationship Diagram, or press Alt+3.
  2. Choose a datasource in the list at the bottom of the layouts panel. Use Search datasources... to find one. Only datasources that have tables are listed, and each one shows its table count.

The button beside the search box switches how the list is ordered: Type groups datasources by source type (the default), and A-Z lists them alphabetically.

The built-in diagram always shows one datasource. On a custom layout the list also offers All Datasources, which spans every datasource.

The diagram opens on the built-in Lake Diagram tab. Create your own layouts for other arrangements of the same tables.

SettingWhat it doesDefault
Datasource ordering (button Type or A-Z)Groups datasources by source type, or lists them alphabetically.Grouped by type (Type)
Unconnected tablesPlaces tables with no relationship Below the connected tables, or Side of them.Below
CardinalitySets how rows of two linked tables match. Used in Create Relationship and Set Relationship Type.One to One

Create a layout

  1. Click New Layout in the layouts panel.
  2. Type a name in New Layout Name and click Continue.

A new layout starts empty. To delete a layout, hover over its tab, click its delete icon and click Delete in the Are you sure? dialog. See Diagram layouts for renaming, duplicating and removing layouts, and for what the diagram remembers.

Warning

Deleting a layout is permanent. The dialog says it cannot be undone.

Add tables to a layout

Tables go into custom layouts, not into the built-in Lake Diagram.

  1. Select a custom layout.
  2. Drag a table from the Lake 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 highlights it and shows Table already exists in this layout. If it cannot be added, it 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.

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.

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.

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 shows up to ten fields, with the fields used in relationships and the primary key first. Click Show more to list the rest, and Show less to fold the list again.

Remove from Layout and Related Tables appear only in custom layouts. In the built-in Lake Diagram, only Edit table is available.

A table node can show one of two badges:

Find your way around the canvas

Create a relationship

  1. Right-click the canvas and choose New relationship; the menu item shows its shortcut beside it. With the focus inside the diagram, you can also press Alt+N.
  2. In Create Relationship, choose Primary Table, Primary Field, Referenced Table, Referenced Field and Cardinality.
  3. Click Create.

The new line appears on the canvas, and its details open in the side panel. Create stays unavailable until both fields are chosen and their types match.

You can also create a relationship by dragging: hover over a field row to reveal its handles, then drag from a handle to a field in another table. A dashed line follows the pointer and snaps when you release close to a field.

The cardinality options are One to One, One to Many and Many to One. In One to Many, each row of the primary table can match many rows of the referenced table.

To change a relationship's type, click its line, click Edit relationship (or double-click the line), choose a type in Set Relationship Type and click Confirm. To remove it, click its line, click Delete relationship, then click Remove in Remove Relationship.

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.

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 -.

To load the latest tables from the database before the copy ages out, click Refresh from Database in the canvas toolbar, or Refresh diagram data in the layouts panel. 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.

DataMind OS also refreshes the copy on its own. It does so the next time you open the diagram after you add or remove a datasource, and silently when the copy is more than two days old.

Who can do what

ActionPermission
See the Lake and its diagramView Lake Objects
Create, change or delete a relationshipAdd/Modify Lake Objects

If the server refuses a relationship change, the diagram shows Failed to create reference, Failed to update relationship or Reference remove failed, with the reason underneath. For the full list of Lake permissions, see Who can do what in the Lake.

Limits and edge cases

For the same tool on Warehouse tables, see Relationship diagram. Relationships between BI tables in a semantic model are set up separately, in Relationships and the core table.

Questions, answered

I do not see the tables I just imported. What do I do?

Click Refresh from Database in the canvas toolbar. The diagram keeps a copy, so new tables appear after a refresh, or when DataMind OS refreshes the copy on its own.

Does removing a table from a layout delete it?

No. Remove from Layout removes the table from that layout only. The Lake table stays as it is.

Can I keep several arrangements?

Yes. Create a layout with New Layout for each arrangement.

Why can I not link these two fields?

They have different data types. A relationship needs two fields of the same type.

How do I add all the tables related to one table?

Click the table on the canvas, then click Related Tables in its tools.

What does To be deployed mean on a table?

The table is not deployed yet. Missing PK means the table has no primary key. Deploy the table in Configure a table.

Can I undo a change in the Lake diagram?

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

Can I tidy a messy diagram?

Yes. Click Auto Layout, choose a preset under Layouts and choose Below or Side under Unconnected.

How do I find a table or column on the diagram?

Type in Search... in the canvas toolbar. Results cover tables and columns; picking one brings it into view and highlights it for two seconds.

Can I see the whole diagram at once?

Yes. Click Show all in the canvas toolbar to fit every table on screen, and turn on Show Minimap for a small overview of the whole diagram.