Working with SQL Prompt AI
Published 22 August 2025
To begin working with Prompt AI, first you need to open the Prompt AI window, which can be done through several different methods:
- Use the
Alt + Z
key bind. You can use this key binding on either an empty query, or you can select a portion of SQL and use it on that. - Select a portion of SQL or an entire query, right click, and select the
Open Prompt AI
Option. - Select a portion of SQL, and click on the Prompt AI icon that pops up under the selection.
Please note that this icon will only pop up if you have theShow icon for editor selection
option checked in the options menu. This is enabled by default. - Click on the
SQL Prompt
menu option, and pressOpen Prompt AI
. This option does not require a SQL selection to be made.
Please note, if you only select a portion of a query, the Prompt AI window will only edit the selected portion. You will know when Prompt AI is able to work with a selection of SQL as it will be highlighted in orange.
Once you have the Prompt AI window open, you will be presented with the following screen. The main portion of the window is the free text box, that you can use to tell Prompt AI what to do, be this to generate or tweak a script, or explain what a selected script is doing.
You can use this free text window in your natural language, it is not limited only to English.
If you are unhappy with the result that Prompt AI gave you, you can either decline the changes, which will revert the query back to its state before Prompt AI was used, or you can press the regenerate button, highlighted in the following image. This button will have Prompt AI try to regenerate the query, which can lead to some slight tweaks being made.
If you have a portion of SQL selected, you will also be able to press the Explain SQL
button, which will automatically get Prompt AI to generate an explanation.
When you have generated some SQL using Prompt AI, the History
tab becomes available.
The History
tab can be accessed by pressing the button at the top of the Prompt AI window. On the new page, you will see a list of all the queries you have made while this window of Prompt AI has been open. Clicking on the options here will revert your query back to the state it was in before making this query. You can access the latest state of the query by pressing the -- Latest Query –-
option.
Please note that the history in this page does not persist if you close the Prompt AI window.
Another feature you can start using once you have generated your first SQL query is follow-up suggestions. Prompt AI's follow-up suggestions are automatically displayed by Prompt AI, and are designed to give you an idea of what else could be added. You are also able to click on the suggestions, which will automatically send the suggestion as a prompt to Prompt AI
You can also have Prompt AI generate initial suggestions when you first open the window. To do this, you must enable the Generate initial suggestions using SQL History
setting in the Prompt AI options page.
Enabling this will send Prompt AI your last queries that were saved using SQL History in the background, in order to generate a set of relevant suggestions to you when you open the Prompt AI window. As with the follow-up suggestions, you are able to click on these to have Prompt AI generate SQL based on them.