6.3. Source code preview

Another interesting tool is the source code preview which permits the user to visualize the source code of any object on the fly without the need to export them to a SQL file (in case of the SQL code) or by opening the database model file in a text editor (in case of XML definition).

Additionally, it is possible to modify the generated SQL syntax for the current object by changing the value of the field Version. This technique is quite useful when you need to see how the code is generated in different versions of PostgreSQL in order to determine if that code can be or not exported to a specific version. Also, it is possible to save the current displayed SQL code to an external file for test purposes by clicking the Save SQL button.

This dialog can be activated by pressing the shortcut Alt + S or by right clicking an object and select 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 following:

Field Description
Name The name of the current object which the code is being visualized.
Type The type of the current object.
Version 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. The changes in this field only affects the SQL code generation.
SQL This tab shows the SQL code of the object.
XML This tab shows the XML code of the object.
Code display This field changes the way the code is generated for certain kind 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 object's children code. This option is used only by schemas, tables and views.

Aug 30, 2018 at 15:19