Skip to content

AI command

Note

If you're using DBeaver Community, see the setup guide in GitHub Wiki.

The AI command lets you run natural language requests directly in the SQL Editor. Just type @ai with your question, and Team Edition will generate and execute the SQL for you.

Using AI command

To use the AI command:

  1. Open the SQL Editor.
  2. Type your request using the @ai command.

    Example

    @ai show all customers with invoices in the last month

  3. Execute the AI command. The results will appear in the Result panel.

AI commands can execute queries directly against the database. To control how this happens, configure the AI query execution settings.

Control AI query execution

By default, SELECT queries execute immediately, while modification and schema changes require confirmation.

You can adjust this behavior in Window -> Preferences -> General -> AI -> AI configuration -> AI query execution.

Preview and confirm AI command queries

If confirmation is enabled, running an @ai command opens a dialog before execution.

How it works:

  1. When you run the @ai ... command, the dialog shows a warning about the type of query (for example, schema modification).
  2. In the confirmation dialog, click Show Query to review the generated SQL.
  3. If the query looks correct, click Yes to execute. Otherwise, click No to cancel and adjust your request.

Warning

If confirmations are disabled and autocommit is on, AI commands can change data immediately. Enable Show confirmation for modify and schema queries, or use Disable autocommit to stay safe.