v1.2.0 Summary Chapter 2: Modeling basics 2. Start modeling 2.6. Source code input fields
No documentation was found matching the provided version! Browsing the latest one.

2.6. Source code input fields

In almost all source code input fields, we'll find a numbered section that indicates the number of lines loaded. Also, by default, most source input fields highlight the current line (where the text cursor currently lies) in light yellow. These settings can be changed in General settings in the section Printing & Code. Additionally, in these fields, the user can change the text case or change the indentation by selecting a portion of it and hitting Ctrl + U for upper case text, Ctrl + Shift + U for lower case text, Tab to ident right and Shift + Tab to ident left. The mentioned actions can be activated via the context menu as well.

pgModeler allows the loading of the contents of external source files to assign them to any object that demands the usage of SQL code, like functions, views, or custom SQL code. The area highlighted in the red rectangle in the image below shows seven actions available in any input field that is configured to accept source code via an external editor, and they are described as follows:

  • Load: allows the user to simply load the contents of an external text file into the current field.
  • Save: saves the contents of the input field in a file.
  • Copy: copies the contents of the input field to the clipboard.
  • Edit: does some tricks and writes the field's contents into a temporary file and opens it in the configured external editor. Inside the loaded editor lies the contents of the source field, focused in pgModeler, that was saved to the temporary file. The user can now edit the file externally, not forgetting to save it. Once the editor is closed, pgModeler detects the changes in the temporary file and places its new contents in the focused field.
  • Search: toggles the built-in text search widget.
  • Wrap: toggles the text wrap for long lines, breaking them by taking the input field's width as the maximum line width and putting the exceeding content in the line below, without affecting the total number of lines in the text, only the visualization is improved.
  • Clear: wipes out all text in the current field.


In the General settings, it's possible to define which editor will open when requested, as well as its arguments (specific for each chosen editor). It's important to warn about the risks of using external applications to edit sources in pgModeler. Since pgModeler isn't capable of guessing if the selected executable is an editor or a system command that wipes out all data from the computer, the user always needs to double-check what application is being used as the preferred source code editor.


Apr 25, 2025 at 08:12