CodeInsight in the Interactive SQL window

From InterBase

Go Up to CodeInsight


In the Interactive SQL window, Smart CodeInsight is docked on the right side of the window by default.

Isql ai.png

When you write prompts using any of the available macros, you also drag and drop entities from the Entity Selector.

Refer to the Tools Section for details on the available tools.

You can also use Smart CodeInsight with any selected SQL code on the SQL Input Area.

Isql codeinsight.png

To access the available options:

  1. Select your code on the Input area.
  2. Right click over the selected code
  3. Go to Smart CodeInsight and select an option.

The Following options are available:

Optimize the Current Query
It asks the AI engine to optimize the selected SQL code. Since it sends the Query, Plan, and metadata for all entities involved, the selected query needs to be needs to be preparable by the InterBase engine. Otherwise, the engine will raise an error.
Pretty format SQL
It Asks the engine to pretty format the selected SQL code. The response provides general suggestions, but the output is going to be dependent on the engine/model used. The same model might not format the code in the same way if run back-to-back.
Convert from Dialect 1 to Dialect 3
Sends the selected SQL code to the AI engine and asks how to convert it from Dialect 1 to Dialect 3. It also sends links to IB documentation to stablish differences between D1 and D3.
Explain the Select SQL
It asks the AI engine to explain what the selected SQL code does. Since it sends the Query, Plan, and metadata for all entities involved, the selected query needs to be needs to be preparable by the InterBase engine. Otherwise, the engine will raise an error.
Convert to Stored Procedure
Converts the selected SQL into a stored procedure with input/output variables. Since it sends the Query, Plan, and metadata for all entities involved, the selected query needs to be needs to be preparable by the InterBase engine. Otherwise, the engine will raise an error.
Display Results in Editor/CodeInsight window
Selecting Editor, the response is added at the bottom of the editor. Selecting CodeInsight the response displays in the CodeInsight window. The Command prompt area is not updated.

Tools Section

Depending on the current text of the window the following options can be available:

Engine selection
A combo box to set the engine used for prompts. When the Smart CodeInsight window is created, it uses the default engine set in the Smart CodeInsight options. The window will use the default engine unless this value is changed here.
Note:
Changing the Default AI engine in the Smart CodeInsight options, does not propagate to active windows and you have to change it here.
Clearci.pngClear
clears the command prompt
Copyall.pngCopy from Editor
This copies all the contents of the editor into the command prompt (only available when there is an editor available)
Copyselected.pngCopy Selected from Editor
Copies only the selected portion of the editor into the command prompt (only available when there is an editor available)
Generateci.pngStart Generating
Sends the prompt to the AI engine.
Cancelci.pngCancel
Cancels a running prompt.

Advance To: