WebStorm 2022.3 Help

Database diagrams

Database diagrams graphically show the structure of the database and relations between database objects. You can generate a diagram for a data source, a schema, or a table. To create relations between database objects, consider using primary and foreign keys.

You can save the generated diagrams in two formats: UML and PNG. The UML format is an internal format developed specifically for WebStorm. It is not supported by other products. If you want to share the created diagram, consider using PNG.

Also, you can build execution plans. Execution plan is a set of steps that were used to access data in a database. WebStorm supports two types of execution plans:

  • Explain Plan: the result is shown in a mixed tree and table format on a dedicated Plan tab. You can click the Show Visualization icon (the Show Visualization icon) to create a diagram that visualizes the query execution.

  • Explain Plan (Raw): the result is shown in a table format.

Pan and zoom the diagram

  • To pan and zoom the diagram, use your touchpad, scroll bars or the mouse wheel for vertical scrolling and Shift + mouse wheel for horizontal scrolling. You can also use Shift + mouse wheel for zooming.

  • To use the magnifier tool, keep the Alt key pressed, and hover your mouse pointer over the desired areas of the diagram. Use the mouse wheel to extra zoom the diagram area within magnifier tool.

Generate a diagram for a database object

  • In the Database tool window (View | Tool Windows | Database), right-click a database object and select Diagrams | Show Visualization.

Generate a diagram for a database object

Build a query plan

  1. Right-click an SQL statement, and select Explain Plan.

  2. By default, you see the tree representation of the query in the Plan pane. To see the query plan, click Show Visualization the Show Visualization button, or press Ctrl+Alt+Shift+U.

Viewing SQL Query map

Enable column comments

  1. Generate a diagram. For more information about generating a diagram, see Generate a diagram for a database object.

  2. Click the Comments button (the Comments button).

    Enable column comments

Apply colors to diagram objects

  1. In the Database tool window (View | Tool Windows | Database), right-click an object and select Tools | Color Settings.

  2. Select a color and click OK.

Save diagrams in the UML format

This UML format is an internal format supported only by WebStorm.

  • Right-click a diagram and navigate to Export Diagram | Export to File | IDEA .uml.

    To open the saved diagram, drag the UML file to the editor.

Save diagrams in the PNG format

  • Right-click a diagram and select Export Diagram | Export to Image.

Last modified: 05 December 2022