Release notes
This section lists functionality added to DataGrip in the current release. To view release notes for other DataGrip versions, click the version switcher on the help site and select the version that you need.
![Release notes Release notes](https://resources.jetbrains.com/help/img/idea/2024.2/db_release_notes.png)
AI Assistant features
Generate code in editor
AI Assistant can now generate SQL code in the editor. To use this feature, press Ctrl+\, or click Generate Code with AI on the editor toolbar, and enter your prompt. For example,
Add commands that will create a books table and populate it with three sample rows
.
![Entering the prompt in the editor Entering the prompt in the editor](https://resources.jetbrains.com/help/img/idea/2024.2/db_ai_generate_code_in_editor.png)
After the assistant generates the code, you can improve it by specifying your prompt, regenerate the code, and accept it by clicking the corresponding buttons at the bottom of the generated result. You can also take the generated code to AI chat.
![Generated code in the editor Generated code in the editor](https://resources.jetbrains.com/help/img/idea/2024.2/db_ai_generate_code_in_editor_result.png)
Modify tables
AI Assistant can now help you with modifying tables. To get the assistance, in the Modify dialog, click UI AI Assistant to invoke the UI AI Assistant dialog. In the dialog, ask the AI Assistant to do what you need. For example, Switch all the VARCHAR data types to CHAR
.
![AI Assistant generated code for modifying a table AI Assistant generated code for modifying a table](https://resources.jetbrains.com/help/img/idea/2024.2/db_ai_modify_tables.png)
Once the assistant generates the resulting code, you will be able to view and edit it in the preview pane of the dialog.
Explain and fix SQL problems using intention actions
Now you can use AI Assistant’s help to better understand and fix SQL problems. For any problems higher than weak warning, the assistant now suggests an explanation and a fix.
To get an explanation, invoke the intention actions by selecting the highlighted code and pressing Alt+Enter, select AI Actions, then select Explain SQL problem under caret. AI Assistant will provide the explanation in chat.
![AI Assistant explains problems in the selected SQL code AI Assistant explains problems in the selected SQL code](https://resources.jetbrains.com/help/img/idea/2024.2/db_ai_explain_problems.png)
To fix the problem, in the AI Actions popup window, select Fix SQL problem under caret.
This feature can require attaching the database schema to suggest proper explanations and fixes.
![AI Assistant suggests a fix for the problems of selected SQL code AI Assistant suggests a fix for the problems of selected SQL code](https://resources.jetbrains.com/help/img/idea/2024.2/db_ai_fix_problems.png)
Working with data
Scripted data loaders
You can now import the data from your tabular data files. We have implemented the scripted data loaders to enable the import for the following file formats: Excel, JSON, Parquet, and Shapefile.
The loaders are scripted, so you can write and use your custom ones. To add your custom scripted loaders, place them in their specific directory in Scratches and Consoles | Extensions | Database Tools and SQL | data | loaders.
To import the data, drag your file from the Files tool window to the schema in Database Explorer, and configure the import settings in the Import dialog that opens.
![Import dialog for importing data from an Excel file Import dialog for importing data from an Excel file](https://resources.jetbrains.com/help/img/idea/2024.2/db_scripted_data_loader_import.png)
Data Editor and Viewer
Related rows in Grid floating toolbar
Now you can navigate to related records by using the table cell's floating toolbar. To do that, click the cell, then click Related Rows icon on the floating toolbar that appears.
![Floating toolbar for grid cells Floating toolbar for grid cells](https://resources.jetbrains.com/help/img/idea/2024.2/db_grid_floating_toolbar.png)
To remove the action from the floating toolbar, open the toolbar and click More, then select Customize This Toolbar. In the Customize Grid Floating Toolbar dialog, select the action and click
Remove. You can bring it back in by selecting Grid Floating Toolbar and clicking Add.
You can set the action behavior using the Related Rows action behavior setting. To do that, navigate to . The Navigate And Select First option will select the first referenced rows and show all the rows in the table. The Navigate And Filter All one will show the referenced rows only.