Schema ERD

Under Schema → Schema ERD, DB Studio draws an entity-relationship diagram of a connection's live schema: its tables and views, and the foreign keys between them. Use it to find your way around an unfamiliar database, to see how tables relate before you write a change, or to share a schema's shape as an SVG file. Any role can open it. It only reads the database; your arrangement of the diagram is kept in your browser, not on the server.

Supported Engines

The connection picker lists only connections of these engines, each with its engine after a middle dot. If the server cannot read a connection's engine, the ERD says so and names the engines it reads. If the list of engines cannot be loaded, the page says so with Retry, and the picker says connections are listed once the engines load.

Loading a Diagram

Pick a connection and choose Load ERD; Reload reads the schema again. Picking another connection clears the diagram until you load it. Above the diagram, a count gives the tables and views shown, the foreign keys drawn, and how many foreign keys point to tables outside the diagram, for example 22 tables · 8 views · 36 foreign keys.

What Is Drawn

The Inspector

Click, tap or press Enter on a table or view to open it in the inspector. The inspector sits beside the diagram on wide screens and under it on narrower ones, such as a tablet or phone.

Schema Filter and Search

When the database has more than one schema, the Schema filter limits the diagram to one of them, and the counts follow it. Find a table searches table and view names in every schema. Pick a match, or press Enter for the first one. The diagram then scrolls to it and opens it in the inspector, switching the schema filter if the match is in another schema. To narrow a search to one schema, type the schema name, a dot, then the table name.

Arranging the Diagram

Drag a table to move it. Your arrangement is saved in your browser for that connection and holds only the tables in its diagram. Tables added since are placed where they do not overlap the saved ones. Reset Layout returns the connection to the default grid. Arrangements are kept per browser, so another browser or another user starts from the grid.

Keyboard, Touch and Pen

Download

Download SVG saves the diagram as shown, with your arrangement and schema filter, as a standalone SVG file named after the connection (and the schema, when filtered). It opens in any browser or drawing tool.