# Schema Visualizer (/docs/guides/schema-visualizer)

See your database as an entity-relationship diagram of tables, columns, and foreign-key relationships you can search, rearrange, and export.

The Schema Visualizer draws your database as an interactive entity-relationship
diagram. Open it from the sidebar.

## What it shows [#what-it-shows]

Each table is a card listing its columns with type and primary-key / foreign-key
badges. Foreign keys are drawn as directed edges between the tables involved.

## Interact [#interact]

- **Drag** tables to rearrange them in edit mode (`E`); the layout is saved per
  connection.
- **Click a table** to open the details panel with its columns, indexes, and
  one-click **SQL DDL** or **Drizzle** export, plus an **Open in Studio** button
  to jump to the data.
- **Search** with the bar at the top. Plain text highlights matching tables and
  dims the rest; you can also use tokens like `table:users`, `column:email`,
  `type:uuid`, `schema:public`, `pk`, `fk`, `nullable`, and `index`.
- **Fit to view**, toggle the **minimap**, and toggle **edit mode** from the
  toolbar.

## Export the diagram [#export-the-diagram]

From the toolbar's export menu you can save the schema as **JSON**, an **SVG** or
**PNG** image, **SQL DDL** (`CREATE TABLE` statements), or **Drizzle** ORM code,
handy for documentation or for bootstrapping a schema file.
