Find and fix problems with AI
AI Assistant helps you find and fix problems in your code by analyzing the provided context, detecting potential issues, and providing suggestions to resolve them.
Find problems
Select a code fragment and click
in the popup that appears.
In the menu, click Find Problems.

The AI Chat will open, where the model will analyze the selected code fragment, identifying potential issues and suggesting possible solutions.

Fix SQL code
Available in: DataGrip and IDEs with Database Tools and SQL plugin starting from IDE version 2024.3
This feature may require attaching the database schema to suggest proper fixes.
For any problems higher than weak warning, the assistant suggests a fix. To use it, do the following:
In the editor, invoke the intention actions by placing the caret at the highlighted code and pressing Alt+Enter, then select AI Actions.
In the AI Actions dialog, select Fix SQL problem under caret.

AI Assistant will provide its fix in editor.

AI Assistant can also suggest fixes for syntax errors. To use them, do the following:
In the editor, invoke the intention actions by placing the caret at the highlighted code and pressing Alt+Enter, then select Fix with AI Assistant.

AI Assistant will provide its fix in editor.

Query execution error handling
Available in: DataGrip and IDEs with Database Tools and SQL plugin starting from IDE version 2024.3
AI Assistant can explain and fix SQL query execution errors in editor tabs. The corresponding actions are available in the error message area.
Explain SQL errors
AI Assistant can explain the SQL execution error in your code. You can also ask further questions about the error in AI chat.
This feature may require attaching the database schema to suggest proper explanations.
Fix SQL errors
AI Assistant can fix the SQL execution error in your code.
This feature may require attaching the database schema to suggest proper fixes.
After running an SQL query and encountering a query execution error, click Fix with AI in the error message area.

AI Assistant generates a fix for the query execution error in the editor.

