v1.1.0 Summary Chapter 6: Advanced tools 6. Introduction 6.3. Source code preview

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 the 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 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. Also, it is possible to save the currently displayed SQL code to an external file for testing 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 selecting 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.
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.
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 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 object's children's code. This option is used only by schemas, tables, and views.

Mar 14, 2024 at 15:17