This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
AI support in DBeaver Community edition is limited. Lite, Enterprise, and Ultimate editions provide additional features. See the full list.
Table of contents
DBeaver Community Edition provides AI SQL Generation and AI command to help you write SQL queries in natural language.
Type a request in plain text, and the AI will generate the corresponding SQL.
Supported providers:
- OpenAI (GPT language model)
- GitHub Copilot (Copilot)
AI features in DBeaver Community
AI SQL Generation
To use the AI SQL Generation:
-
Launch the SQL Editor.
-
Click on the AI Assistant icon
located in the left toolbar
of the SQL Editor.Note
: The toolbar is customizable. For further information, refer to Toolbar Customization article.
-
Input your natural language request in the AI SQL Generation window.
-
Click Translate to get the SQL query.
Tip: You can also use the
@aicommand directly in the SQL Editor.
Define the scope
To enhance the precision of AI-assisted SQL queries, especially in extensive database schemas, setting the scope is key. This action narrows down the AI's focus, ensuring it generates more relevant queries.
-
In the AI SQL Generation interface, navigate to the Scope field.
-
You can choose from:
- Current Schema: Focuses the AI on the schema you are currently using.
- Current Database: Limits the AI to the database currently selected.
- Connection: Sets the AI to consider all schemas within the current database connection.
- Custom: Allows you to define a more specific scope, such as a particular table or schema.
History
The History field allows you to review previous requests.
AI command
To use the AI command:
-
Open the SQL Editor.
-
Type your request using the
@aicommand.Example:
@ai show all customers with invoices in the last month -
Execute the AI command. The results will appear in the Result panel.
Warning
: Depending on your AI query execution settings, the query may run without being shown first. In this case, changes to the database (including deletes) can execute before you see the command. The query appears in the Server output only after execution.
AI Assistant setup
To activate the AI Assistant in DBeaver, configure the API token:
-
Navigate to Window -> Preferences -> General -> AI.
-
Ensure the Enable AI integration option is activated.
-
In the API token field, input your AI secret key.
-
Save the changes. And proceed to add your service keys and configure settings specific to the AI service you’re using:
Providers support
OpenAI
- Sign up on the OpenAI platform.
- Navigate to the API Keys section and generate a new secret key.
- In DBeaver, go to Engine Settings and insert this key into API token field.
- Choose the model.
- Apply the changes.
Note
: OpenAI services are available in specific countries. Consult the supported countries list to verify availability in your location.
GitHub Copilot
-
Sign in to your GitHub account.
-
Go to the GitHub Copilot page and activate a free trial or subscription.
-
In DBeaver, go to Engine Settings and select GitHub Copilot.
-
Click Authorize to get your OAuth code.
-
Click Copy and Open - this opens the GitHub authorization page.
-
Paste the code, confirm access, and authorize the GitHub Copilot plugin.
-
After completing the OAuth flow, the access token will be filled in automatically in DBeaver.
Important: The token is visible only once. After you save the changes, it’ll be masked for security.
-
Choose the model.
-
Apply the changes.
AI integration configuration
For configuring engine configuration, navigate to Window -> Preferences -> General -> AI.
| Setting | Description |
|---|---|
| Enable AI integration | Displays the AI Assistant in the SQL Editor. |
| API token | Input your secret key from the provider platform. |
| Model | Choose the AI model. |
| Temperature | Control AI's creativity from 0.0 (more precise) to 0.9 (more diverse).
Note that higher temperature can lead to less predictable results. |
| Context window size | A larger number allows the AI to use more data for better answers but may slow down response time. Choose based on your balance of accuracy and speed. |
| Write AI queries to debug log | Logs your AI requests. For more details on logging, see Log Viewer. |
Note
: The availability of Engine settings may vary depending on the AI provider you are using.
AI configuration
For configuring specific settings, navigate to Window -> Preferences -> General -> AI -> AI configuration.
General
| Setting | Description |
|---|---|
| Language | Choose the language for AI responses. This affects the language used in answers, explanations, and code comments. |
Besides the listed options, you can also type in a language that's not included in the dropdown menu.
SQL Completion
| Setting | Description |
|---|---|
| Include source in query comment | Shows your original request above the AI-generated query in the SQL Editor. |
| Execute SQL immediately | Runs the translated SQL query immediately after generation. |
AI query execution
These settings control how AI-generated SQL queries are executed. You can choose to run them immediately, show a confirmation prompt, or disable autocommit so changes must be committed manually.
| Setting | Description | Options |
|---|---|---|
| Select | Controls execution of SELECT queries. |
- Execute immediately - run SELECT queries without confirmation.- Show confirmation - ask for confirmation before executing. |
| Modify | Controls execution of data modification queries (INSERT, DELETE, UPDATE). |
- Execute immediately - run modification queries without confirmation. - Show confirmation - ask for confirmation before executing. - Disable autocommit - turn off autocommit so changes require manual commit. |
| Schema | Controls execution of schema modification queries (CREATE, DROP, ALTER, etc.). |
- Execute immediately - run schema modification queries without confirmation. - Show confirmation - ask for confirmation before executing. |
Tip: You will see the generated query before it’s executed if you use Show confirmation.
Send database structure
| Setting | Description |
|---|---|
| Send column data type information | Sends column data types (like INT, VARCHAR, etc.) to the AI provider. Improves completion quality, but consumes more tokens. |
| Send object description | Sends object description to the AI provider. Improves completion, but may consume significant amount of tokens. |
Disable AI Assistant
To turn off AI Assistant temporary:
- Navigate to Window -> Preferences -> General -> AI.
- Deselect Enable AI integration.
Data privacy
We protect your data and privacy with strict safeguards. AI Assistant works with the minimum information required, and all processing follows provider privacy policies.
Learn more in Data privacy.
DBeaver Documentation
- Getting started
- DBeaver configuration
- Security
- Connection settings
- Databases support
- Classic
- Cloud
- Embedded
- File drivers
- Graph
- Database Navigator
- Data Editor
- SQL Editor
- Entity relation diagrams (ERD)
- Cloud services
- AI Assistant
- Data transfer and schema compare
- Task management
- Integrated tools
- Administration
- DBeaver Editions
- Standalone
- Cloud-hosted
- FAQ
- Development


