Another interesting tool is the source code preview which permits the user to visualize the source code of one object or more selected objects on the fly without the need to export them to a SQL file (in the case of SQL code) or opening the database model file in a text editor (in case of XML definition).
Additionally, it is possible to change the generated SQL syntax for the current objects by changing the value of the field PostgreSQL
. This technique is quite useful when you need to see how the code is generated in different versions of PostgreSQL to determine if that code can be or not be exported to a specific version.
This dialog can be activated by pressing the shortcut Alt + S
or by right-clicking a selection of objects and activating the Source code menu item. If no object is selected, the default behavior is to show the source code of the entire database model. All fields in this dialog are described as follows:
Field | Description |
---|---|
Name |
The name of the current object that the code is being visualized. |
Type |
The type of the current object. |
SQL |
This tab shows the SQL code of the object. |
XML |
This tab shows the XML code of the object. |
PostgreSQL |
The version in which the source code must be generated. The SQL tab is automatically updated whenever the user changes the current value of this field. Changing this field only affects the SQL code generation. |
Code display |
This field changes the way the code is generated for certain kinds of objects. The value Original displays only the original object's SQL code. Now, the value Dependencies causes pgModeler to display the original code, including all dependencies needed to properly create the selected object. Finally, the value Children displays the original code, including all objects' children's code. This option is used only by schemas, tables, and views. |