Session 4: Working with Code Workbench

From RapidSQL
Jump to: navigation, search

Go Up to Rapid SQL Tutorial exercises

The Code Workbench lets you configure resources for two SQL Editor features:

  • Code Templates
  • Auto Replace

Code templates are complete code blocks that can be easily added to open windows or scripts with a few keystrokes. When you type CTRL+SPACE, the Code Assist menu opens, letting you select a code template for insertion in the editor window.

af0f5ce1.jpg

Auto Replace lets you define shortcuts consisting of a few characters that represent longer character strings. Instances of these Auto Replace expressions are automatically replaced by the replacement string on activation events such as typing SPACE, TAB, or RETURN. This feature is useful for creating shortcuts for one-line commands or SQL statement subsets, or even to detect and fix common typographical errors such as teh for the.

For example, consider an Auto Replace definition with an expression of sel to represent Select * From:

af0f5ce7.jpg

If the associated activation event includes a SPACE then on typing sel followed by pressing SPACE, the following replacement occurs:

af0f5cec.jpg

Rapid SQL loads a default set of Auto Replace and Code template definitions at startup, but you can also add, edit, and delete definitions. Also, you can save sets of definitions to file and subsequently load specific sets of definitions, allowing you to customize your templates to different platforms or development projects.

To invoke Code Workbench settings:

  1. Select Tools > Code Workbench.
    af0f5cf3.jpg
    The Settings tab lets you enable the Auto Replace and Code Template features.
  2. Inspect the Code Templates and Auto Replace tabs.
  3. Click OK.

Proceed to Session 5: Building a Database Project.