DBeaver Documentation

DOWNLOAD pdf

AI smart completion

To interact with databases using the AI Smart completion:

  1. Activate the AI assistance. > For users of the Community edition to access AI smart completion, install the AI extension.
  2. Launch the SQL Editor.
  3. Click on the GPT Chat smart completion icon located in the left toolbar of the SQL Editor.

    > Note: The toolbar is customizable. For further information, refer to Toolbar Customization article.

  4. Input your natural language request in the AI smart completion window.

  5. Click Translate to get the SQL query.

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.

  1. In the AI Smart completion interface, navigate to the Scope field.

  2. 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.

Install AI assistant in Community Edition

For users of the DBeaver Community, the GPT extension requires manual installation:

  1. Navigate to Help -> Install New Software.
  2. Within the installation dialog, locate the Work with dropdown. Choose DBeaver AI integration from the list.

  3. Check the box next to AI Support. Click Next and proceed through the installation prompts.

  4. A Trust Artifacts window will appear. Ensure you select all the artifacts listed and click on Trust Selected.
  5. Once the installation is complete, restart DBeaver.
  6. After restarting, launch the SQL Editor. On the left toolbar, you’ll now see the GPT Chat icon .