You can use the Snippets Manager to open a number of customizable code blocks to choose from. Snippets Manager enables you to:
To access the Snippets Manager, navigate to the SQL Complete menu and select Snippets Manager.
1. On the Snippets Manager toolbar, click New Snippet.
2. In the Title and Description fields, specify the name and description of the snippet respectively.
3. In the Shortcut field, enter a name for the snippet shortcut. The shortcut will be used to insert the snippet into the code. In addition, it will be displayed in the suggestion box.
4. In the Literals field, define the literals (placeholders) of the code snippet that can be updated.
5. To keep the changes, click Save.
The default path to the snippet is C:\ProgramData\Devart\dbForge SQL Complete\Snippets. If you want to set a new file location, click More Options in the Location field.
To modify the snippet, select the snippet you want to update in the snippets tree, modify the parameters, and click Save.
To organize snippets into folders, click New Folder on the toolbar, specify the folder name, and move snippets to the folder or create new ones.
To delete the snippet or folder, select the element you want to remove, click Delete on the toolbar, and confirm the deletion.
SQL Complete provides the following predefined placeholders, which deliver multiple replacement points for the same parameter:
||Specifies the position in the text where the cursor should be moved after the snippet has been edited.|
||Inserts the current date in the format yyyy-mm-dd.|
||Inserts the current time in the format hh:mm:ss.|
||Inserts the login from which the user is connected to the SQL Server.|
||Inserts the name of the user who is currently connected to the SQL Server.|
||Inserts the name of the database to which the current query tab is connected.|
||Inserts the name of the server you are currently connected to.|
When a snippet is invoked, the appropriate text/value will be inserted into the placeholder.
Each code snippet has an individual set of User Literals that can be created, updated, or deleted.
1. In the tree, select the snippet for which you want to create the literal.
2. Under the Literals section, click Add.
3. In the Edit Literal pop-up that opens, enter the following information, and then click Ok:
4. To keep the changes, click Save.
To modify the user literal, click Edit and follow the steps from the Create a user literal procedure.
To remove the user literal, click Remove and then click Save on the toolbar.