v0.9.4 Summary Chapter 4: Handling settings 4. Introduction 4.5. Snippets settings

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) a simple programming language used internally by pgModeler to generate code. In order to provide the users a way to store their 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 a new snippet, edit the current snippet, delete the 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.

Jan 14, 2022 at 14:06