ER diagrams in Moon Modeler are mainly used to visualize database structures. ER diagram (entity-relational diagram), abbreviated as ERD, describes objects in mostly relational databases.
However, Moon Modeler also allows creating diagrams for noSQL databases such as MongoDB, and you can also find support for Mongoose or GraphQL. In this case, we tend to use the term ERD-like visualization or schema design.
Read below about creating ER diagrams in Moon Modeler
The Main diagram and sub-diagrams
- Contains all database objects (all schema objects)
- Objects can be displayed or hidden
Sub-diagram (other diagrams):
- Contains a subset of objects of the Main diagram
- Objects can be added to or removed from the diagram, but cannot be hidden
Adding a new diagram
You can click the button Add diagram (1) to create a new, empty diagram. This can be useful if you plan to create a new part of your database design from scratch. If you wish to add already existing objects to a new or existing diagram, select the objects and right-click any of them either in the side panel (2) or on the active diagram (3), and select Add to another diagram (4).
Setting the diagram name and properties
If you wish to rename the diagram or set other graphical properties, either right-click the tab name and click Edit to open the modal form or edit the properties directly in the side panel.
Displaying items from the Main diagram
At bottom of the left side panel, you can find switch Show items from the Main diagram.
Enable the switch (1) to display items that exist in the project & the main diagram, but are not in the active diagram.
The items are displayed as disabled (2). You can right-click any of them and select Add to diagram (3).
Diagram items management
If you wish to see a list of all objects, search in the list and add or remove additional objects, right-click the diagram area, and select Manage diagram items.
The Diagram items modal form opens. See the objects included (checkbox checked, see 1) and objects that are available for addition. You can also filter the grid by specifying the object name in the Filter input field (2).
If you want to remove an object, you can use the Diagram items modal form, or select the object and press the Del key or click the Delete icon on the toolbar.
Then you can choose to either remove the object from the diagram or delete it from the project.
Adding diagrams by Schemas or by Databases
This feature is available in PostgreSQL, MySQL and MariaDB projects. Right click the Main diagram tab and choose Add diagrams by Schemas or right click the
A window appears with a selection of schemas for which you want to create a diagram. The result will then be the creation of new diagrams.
Changing where tabs are displayed in Moon Modeler
In the Settings, you can select if you want to display the tabs above the diagram or below the diagram.
Diagram specific features
- Diagram specific colors/background colors
- Objects in each diagram can be formatted differently (color, position, size etc.)
- Objects alignment and resize
- Print to PDF
- Creation of HTML reports for selected diagram
- Script generation for selected diagram – see below
Generating scripts for a diagram
In case you have multiple ER diagrams in your project, you can generate the resulting script only for the selected diagram.
ER diagram can be created for the following relational databases:
- PostgreSQL – https://www.postgresql.org
- MariaDB – http://www.mariadb.com
- MySQL – https://www.mysql.com
- SQLite – https://www.sqlite.org