Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

docs: erd (#75647)

Alex Yarosha3176eb0cac8
diff --git a/docs/data-studio/dependencies/graph.md b/docs/data-studio/dependencies/graph.md
index 85893fd7942..66805fd3bdc 100644
--- a/docs/data-studio/dependencies/graph.md
+++ b/docs/data-studio/dependencies/graph.md
@@ -13,11 +13,12 @@ redirect_from:
The dependency graph provides a visual representation of how your Metabase content is connected. You can use it to follow how data flows through your Metabase to better understand the impact of any changes you make.
+If you're looking for a visual representation of foreign key relationships between tables, check out the [Schema viewer](../schema-viewer.md) instead.
+
## What the dependency graph tracks
-The dependency graph tracks the relationships between:
+The dependency graph tracks the relationships between Metabase entities:
-- Tables
- [Questions](../../questions/introduction.md)
- [Models](../../data-modeling/models.md)
- [Snippets](../../questions/native-editor/snippets.md)
@@ -26,6 +27,10 @@ The dependency graph tracks the relationships between:
- [Dashboards](../../dashboards/introduction.md)
- [Documents](../../documents/introduction.md)
+Dependency graph will also show the dependencies of Metabase entities on the tables that serve as data sources for those entities.
+
+To see foreign key relationships between tables, see the [Schema viewer](../schema-viewer.md) instead.
+
## Viewing the dependency graph
To open the full dependency graph:
@@ -77,3 +82,4 @@ You can use the dependency graph to replace query sources in bulk. See [Replace
- [Library](../library.md)
- [Dependency diagnostics](./diagnostics.md)
- [Replace data sources](./replace-data-sources.md)
+- [Schema viewer](../schema-viewer.md)
diff --git a/docs/data-studio/images/schema-viewer.png b/docs/data-studio/images/schema-viewer.png
new file mode 100644
index 00000000000..9b79c1a5052
Binary files /dev/null and b/docs/data-studio/images/schema-viewer.png differ
diff --git a/docs/data-studio/managing-tables.md b/docs/data-studio/managing-tables.md
index 9192ad221b4..dd1d6b6cc3d 100644
--- a/docs/data-studio/managing-tables.md
+++ b/docs/data-studio/managing-tables.md
@@ -125,3 +125,4 @@ Measures are saved aggregations on a table that people can use in the query buil
- [Table metadata editing](../data-modeling/metadata-editing.md)
- [Segments](./segments.md)
- [Measures](./measures.md)
+- [Schema viewer](./schema-viewer.md)
diff --git a/docs/data-studio/overview.md b/docs/data-studio/overview.md
index 99b771c201a..c42c845796b 100644
--- a/docs/data-studio/overview.md
+++ b/docs/data-studio/overview.md
@@ -19,13 +19,15 @@ Data Studio provides tools to shape and track your data so everyone can trust th
- **[Library](./library.md)**\*: A curated space for your organization's most trusted analytics content—tables, metrics, and SQL snippets that your data team recommends.
- **[Managing tables](./managing-tables.md)**: Add table metadata to make tables easier to work with.
-- **[Segments](./segments.md)**: Create saved filters on tables so people can use consistent definitions when building queries.
-- **[Measures](./measures.md)**: Create saved aggregations on tables so people can use consistent calculations when building queries.
-- **[Glossary](../exploration-and-organization/data-model-reference.md#glossary)**: Define terms relevant to your business, both for people and agents trying to understand your data.
+ - **[Segments](./segments.md)**: Create saved filters on tables so people can use consistent definitions when building queries.
+ - **[Measures](./measures.md)**: Create saved aggregations on tables so people can use consistent calculations when building queries.
+- **[Schema viewer](./schema-viewer.md)**\*: Visualize relationships between tables as an entity-relationship diagram (ERD).
- **[Dependency graph](./dependencies/graph.md)**\*: A visual map of how your content connects, so you can understand the impact of changes before you make them.
+ - **[Replace data sources](./dependencies/replace-data-sources.md)**\*: Swap out a table or model across all content that uses it, in one operation.
- **[Dependency diagnostics](./dependencies/diagnostics.md)**\*: See which items have broken dependencies, or that aren't used.
-- **[Replace data sources](./dependencies/replace-data-sources.md)**\*: Swap out a table or model across all content that uses it, in one operation.
+
- **[Transforms](./transforms/transforms-overview.md)**: Wrangle your data in Metabase, write the query results back to your database, and reuse them in Metabase as sources for new queries.
+- **[Glossary](../exploration-and-organization/data-model-reference.md#glossary)**: Define terms relevant to your business, both for people and agents trying to understand your data.
\* Available on [Pro and Enterprise plans](https://www.metabase.com/pricing/).
diff --git a/docs/data-studio/schema-viewer.md b/docs/data-studio/schema-viewer.md
new file mode 100644
index 00000000000..ef02faef943
--- /dev/null
+++ b/docs/data-studio/schema-viewer.md
@@ -0,0 +1,61 @@
+---
+title: Schema viewer
+summary: Visualize relationships between tables in your database using an entity-relationship diagram (ERD)
+---
+
+# Schema viewer
+
+_Data Studio > Schema viewer_
+
+{% include plans-blockquote.html feature="Schema viewer" %}
+
+The schema viewer helps you understand relationships between tables in your database.
+
+![Schema viewer](./images/schema-viewer.png)
+
+If you're looking for a visual representation of dependencies between _Metabase entities_ (questions, metrics etc) and their underlying tables, check out the [dependency graph](./dependencies/graph.md) instead.
+
+## What the schema viewer shows
+
+For a particular schema (if your), the schema viewer will display:
+
+- All tables in the schema (including hidden tables)
+- Database names for tables and fields
+- Database types for fields
+- Foreign key relationships _set in Metabase_ (as arrows between tables)
+- Entity keys _set in Metabase_
+
+Schema viewer displays relationships based on the [Foreign Key semantic type](../data-modeling/metadata-editing.md) defined in Metabase, not based on constraints defined directly in your database. However, during [database sync](../databases/sync-scan.md), Metabase automatically maps database foreign key constraints to foreign key semantic types, so in most cases you won't need to set these manually.
+
+If you've defined additional foreign key relationships in Metabase table metadata that don't have corresponding database constraints, schema viewer will display those as well.
+
+Similarly, schema viewer displays entity keys based on the [Entity Key semantic type](../data-modeling/metadata-editing.md) defined in Metabase, not on primary key constraints in your database. During sync, Metabase automatically maps database primary keys to entity key semantic types, so they'll usually match. If you've manually set an entity key on a field that isn't a database primary key, schema viewer will display that as well.
+
+## Using the schema viewer
+
+To see the table relationships in the schema viewer:
+
+1. Go to **Data Studio > Schema viewer**
+2. In the top left, select a database.
+3. (For databases that have schemas) Select a schema.
+
+In the schema viewer, you can:
+
+- Use the mini-map in the bottom right to focus on specific parts of your schema.
+- Search for a table and center the schema viewer on that table.
+- Drag and rearrange the tables.
+- Click a table header to open an info panel.
+- Click a foreign key field to navigate to the connected table.
+
+## Permissions for schema viewer
+
+The schema viewer is part of Data Studio, which only people in the Admin or [Data Analysts](../people-and-groups/managing.md#data-analysts) groups can access.
+
+The Data Analyst group additionally needs to have at least [query builder](../permissions/data.md) permissions for one or more tables in a database to use the schema viewer for that database.
+
+## Further reading
+
+- [Managing tables](./managing-tables.md)
+- [Table metadata](../data-modeling/metadata-editing.md)
+- [Syncs and scans](../databases/sync-scan.md)
+- [Dependency graph](./dependencies/graph.md)