DataGrip 2025.1 Help

Find recent queries and files

DataGrip can help you recover the queries that you have run or typed recently. Also, you can find the files that you have recently closed.

Query history

DataGrip saves all the queries you run. You can find the queries in the query history of a data source.

  1. To view the query history for the current data source, click the Browse Query History icon Browse Query History on the console’s toolbar. Alternatively, press Ctrl+Alt+E.

  2. In the <data_source_name> Query History dialog that opens, double-click a query to paste it in the editor.

    In the dialog, text search is available to help you find queries.

Queries log

Any queries that DataGrip runs against your databases are stored in the database.log file. This file can show you what DataGrip does under the hood, but it can also help you restore a query from your history if you do not remember where and when you ran it last.

  1. To open the log file, navigate to Help | Show SQL Log in <file_browser>.

  2. Open the log file from your file browser.

    Alternalively, you can make the file always accessible by attaching the directory with it to your IDE project.

Local History

For the queries that you created in the editor but never run, recovering is also possible. To recover such queries, use Local History.

For more information about Local History, refer to the Local History topic.

  1. In the editor, right-click anywhere in the area and select Local History | Show History.

  2. In the search field, start typing your query

    To restore a specific code fragment, select the revision that contains that fragment. In the diff view on the right locate the piece of code you want to restore and click the chevron button the Chevron button to copy it from the left pane.

Local History for directories

If you manipulate your files from the Files tool window , you can also use Local History to restore deleted files.

  1. In the Files tool window Alt+2, right-click the directory where you want to restore the deleted files and select Local History | Show History.

  2. On the left, select the revision that contains the file you want to restore, right-click that file, and select Revert Selection.

Recent files

In DataGrip, you can open any tab with the file that you have closed recently or by mistake.

  1. To open the previously closed tab, press Ctrl+E.

  2. In the Recent Files popup window, find the file you want to re-open and double-click it.

For more information about the window, refer to the Find recent files chapter.

Recent Locations popup

Clipboard history

DataGrip keeps a record of the items you copy to the clipboard. It starts doing this as soon as you launch the IDE and clears the clipboard history after you close it.

  1. To open the dialog with clipboard history, press Ctrl+Shift+V.

  2. In the dialog, select the entry you want to paste and click Paste.

Find and paste recent queries from the clipboard
Last modified: 01 April 2025