Using the AI Assistant
Only in DbVisualizer Pro
This feature is only available in the DbVisualizer Pro edition.
DbVisualizer offers a built-in AI assistant that helps you work faster and more confidently with your databases and scripts. It supports everyday tasks like writing and improving SQL, understanding and developing schemas, and troubleshooting errors, with explanations and suggestions tailored to what you are working on. You can use it to reason about most aspects of your database or query, from explaining database features to modelling, writing queries and much more.
Activating AI features
The first time you open the AI assistant, you will be asked to log in and accept the AI EULA addendum. If you haven't logged in before, you will need to create an account. Once this has been done, you are ready to put AI to work.
Opting out
AI features in DbVisualizer are strictly opt-in. If you want everything to stay local and avoid any server-side AI processing, simply do not enable the assistant. To disable AI at a later stage, open Tool Properties → AI Assistant and uncheck the Enable AI Assistant setting. This will turn AI features off completely.
Working with the AI Assistant panel
To open the AI assistant, use the button in the top-right corner of the main window. This opens the AI Assistant panel consisting of a large output area and a smaller input area. The basic workflow is to submit a question using the input area, read the response generated by the AI, ask a follow-up question, read the new response, and so on.
If the AI response includes code, it will be presented as a code block that can be copied to the clipboard or inserted into the active editor tab using context actions.
Context information
When connected to a database, you can optionally allow DbVisualizer to include relevant context together with your prompt. This helps the assistant provide more accurate, environment-specific responses. The context includes information about the current database connection (such as database type and driver version), structure (existing databases and schemas), and details about the selected schema (tables and columns). You can include or exclude this information by clicking on the corresponding item in the input area. To see which context data will be included, click the icon in the input area.
The context will be updated automatically when you switch between editor and object tabs, and you can use different context details for each question in your conversation with the AI. To see which context was included with a specific question, click the Details link under the question in the output area.
You will be asked to choose whether the database context should be included by default before you ask your first AI question. You can alter this setting later in Tool Properties → AI Assistant.
Current AI model
The quality of AI-generated answers may vary greatly depending on how you formulate your question, how much context you include, and which AI model is being used. The active model is displayed in the bottom left corner of the input are, and we'll be adding the possibility to switch between models in a future release of DbVisualizer.
Chat history
To start a new chat, press the button in the toolbar at the top of the AI Assistant panel. When you do so, your current conversation will be archived. To open an archived conversation, press the button in the toolbar. When you select an earlier conversation from the list, your current conversation will be archived and the selected conversation will be loaded instead. You will be able to see earlier prompts and responses, and continue the conversation.
Adjusting font size
By default, the font in the AI chat is a little larger than the application font to make it easier to read long responses. If you prefer a different font size, see the Font Scale setting in Tool Properties → AI Assistant. For quicker access, AI assistant settings can also be opened by pressing the button in the toolbar.
AI in the editor
When working on a script in SQL Commander, you can ask the AI assistant questions about the current query directly from the editor by pressing the AI button in SQL Commander's toolbar. If there is a selection in the editor, the selected code will be used. Otherwise, the query at the current position will be selected automatically. This will start a new conversation, and any changes that the assistant suggests can then be applied to your original code using the context actions in the output area.
Explain and fix errors
When your SQL Commander query runs with errors, they are listed in the Log tab. To quickly get an AI-generated explanation of a specific error, select the error in the grid and press the AI button in the Log tab's toolbar. This will open a new chat and ask the AI assistant to explain the error and suggest a fix.
AI balance
Each question to the AI has an associated cost that depends on the size of the input and the generated output, as well as the selected AI model. Note also that every follow-up question in an AI conversation will increase the size of the input, and consequently also its cost.
To see your current AI balance, check Tool Properties → AI Assistant. When you have reached zero AI balance, you will need to refill it to be able to ask more AI questions.