DataSpell 2023.2 Help

Database diagrams

Enable the Database Tools and SQL plugin

This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in DataSpell by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Control+Alt+S to open the IDE settings and then select Plugins.

  2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

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 DataSpell. It is not supported by other products. If you want to share the created diagram, consider using PNG.

Also, you can build execution plans. An execution plan is a set of steps that were used to access data in a database. For more information about creating an execution plan, refer to Visualize a query plan.

Generate a diagram for a database object

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

Generate a diagram for a database object

View and manage diagrams

Pan and zoom

  • 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 over the desired areas of the diagram. Use the mouse wheel to extra zoom the diagram area within magnifier tool.

    Magnifier tool

Enable column comments

  1. Generate a diagram. For more information about generating a diagram, refer to 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 ( Window | Tool Windows | Database) , right-click an object and select Tools | Set Color….

  2. Select a color and click OK. Refresh the diagram to apply the color by clicking the Refresh button ().

    Display of table colors

Save diagrams

Save diagrams in the UML format

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

  • Right-click a diagram and navigate to Export Diagram | Export to File | Save UML Diagram.

    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.

Reference

Icons

Possible icon combinations for columns in diagrams:

Icon

Foreign key

Primary key

Indexed

NOT NULL

Column

Column with a foreign key

Has a foreign key

Column with a primary key

Has a primary key

Indexed column

Indexed

Column that does not accept NULL values

Has the NOT NULL constraint

Indexed column that does not accept NULL values

Indexed

Has the NOT NULL constraint

Indexed column with primary and foreign keys that does not accept NULL values

Has a foreign key

Has a primary key

Indexed

Has the NOT NULL constraint

Indexed column with primary and foreign keys

Has a foreign key

Has a primary key

Indexed

Column with primary and foreign keys that does not accept NULL values

Has a foreign key

Has a primary key

Has the NOT NULL constraint

Column with primary and foreign keys

Has a foreign key

Has a primary key

Indexed column with a foreign key that does not accept NULL values

Has a foreign key

Indexed

Has the NOT NULL constraint

Column with a foreign key that does not accept NULL values

Has a foreign key

Has the NOT NULL constraint

Indexed column with a foreign key that accepts NULL values

Has a foreign key

Indexed

Indexed column with a primary key that does not accept NULL values

Has a primary key

Indexed

Has the NOT NULL constraint

Column with a primary key that does not accept NULL values

Has a primary key

Has the NOT NULL constraint

Indexed column with a primary key

Has a primary key

Indexed

Last modified: 20 September 2023