4.5. Snippets settings

pgModeler supports code snippets which are text fragments mainly used to avoid repetitive code typing when managing databases via SQL tool on Manage view. Snippets can be written in form of pure SQL commands or using a special set of commands known as schema micro language (detailed in Appendix I: Schema micro language) the programming language used internally by pgModeler to generate code. In order to provide the user a way to store his/her own code snippets pgModeler implemented a snippet configuration widget (see below). The widget groups snippets by object type and also provides a basic code validation when writing snippets in the schema micro language.

Option/Action/Attribute Description
Snippets This combo box lists all snippets available. The command buttons beside it are respectively used to create new snippet, edit current snippet, delete current snippet and destroy all snippets.
Filter This combo box filters the list of snippets by category.
ID The unique identifier for the currently handled snippet. This id will be listed in the code completion widget and will be used to insert the code held by the snippet in any source code field.
Applies to Category or object type that the snippet is part of.
Label A brief description of what the snippet means.
Parsable Indicates that the snippet is written in the schema micro language syntax and demands parsing. When using a parsable snippet the attributes surrounded in {} will be replaced by the selected object's matching attributes in the database explorer on Manage view.
Placeholders When handling parsable snippets empty attributes will be replaced by a value in the format {attribute}. Note that this option can affect the semantics of the resulting snippet.
Parse button Runs the validation process for the current snippet.
Add or update button Registers the new snippet or update the contents of the current one.

Aug 27, 2018 at 17:02