Search in DataGrip
Search and navigation tips
Any tree, list, or popup in DataGrip supports a speed search. For example, when you start typing in a tool window, a matching database object is highlighted.
Speed search supports abbreviations. For instance,
ac is enough to find
Select a tool window, a tree, a list, or a popup.
Start typing the item name, for example, the name of a file, class, or field. As you type, the Search for field appears over the tool window showing the entered characters, and the selection moves to the first item that matches the specified string. The matching part of the string is highlighted.
If several items match the pattern, use the Up and Down keys to move between them. Press Enter to open the selected item. Press Escape to hide the Search for field.
Database objects in Search everywhere
To navigate to a table, a view, a procedure, or any other database object, press Shift twice to open the Search Everywhere window.
From the main menu, select Alt+N for mnemonics will select the Include non-project items checkbox and the list of search results will extend to non-project related items.or press Shift twice to open the search window. By default, DataGrip displays the list of recent files. Pressing double Shift again or
Start typing your query. DataGrip lists all of the found results where your query is found. Press Ctrl+Down to jump to the bottom of the list for
more...items or Ctrl+Up to return to the top of the search results.
Click to list the search results in the Find tool window.
Press Tab to switch the scope of your search to tables, files, symbols, or actions.
You can use the following shortcuts to open the search window with the needed scope right from the start:
Ctrl+N: finds a table by name.
- Ctrl+Shift+N: finds any file or directory by name (supports CamelCase and snake_case).
- Ctrl+Alt+Shift+N: finds a symbol.
In this case, the search scope will include columns, indexes, and other objects.
Ctrl+Shift+A: finds an action by name. You can find any action even if it doesn't have a mapped shortcut or appear in the menu. For example, Emacs actions, such as kill rings, sticky selection, or hungry backspace.
To narrow down your search, click the Filter icon on the window toolbar and select the appropriate option.
For example, when you search for files, you can exclude some file types from your search.
To see the results of your search in the Find tool window, click the Open in Find tool window icon on the window toolbar. This icon is disabled when you search in the Actions scope.
In the Search Everywhere window, if you select a table or a view and press Enter, you will see the table editor. If you select functions or procedures, you will see their source code.
If you want DataGrip to open the DDL view for tables and views, turn off the Prefer data editor over DDL editor option. To find this option, open settings by pressing Ctrl+Alt+S and navigate to .
If you want to see an object in the database tree, select the Autoscroll from Editor option. This option takes priority over the settings that you have chosen previously.
In case you want to search for columns in a result set or table, invoke the File Structure action Ctrl+F12 and start typing. Speed search filters columns automatically. Press Enter to navigate to the column that you need.
You can search for text data in your database and filter rows without writing a query.
Search for data in databases, schemes, and separate tables
In the Database tool window ( ), select objects in which you want to perform your search. You can select a database or a group of databases, a scheme or schemes, or even separate tables.
Right-click the selection and select Full-text search. Alternatively, press Ctrl+Alt+Shift+F.
In the search field of the Full-text Search dialog, type your search request and press Search.
In the Find tool window, review search results. To open a database object, double-click it. To return to the Find tool window ( ), press Alt+3.
For more information about the full-text search, see Full-text search in databases.
Using the Find action
To quickly find data inside a table without writing a statement, call up a text search with the Find action Ctrl+F. It is especially helpful if you do not know what column contains the data that you are looking for. Select the Filter rows checkbox to see only rows with found matches.
The Find action works only within the current page of the result set. To configure the page size of the result set, open settings by pressing Ctrl+Alt+S and navigate to , and clear the Limit page size to checkbox.
Using the Row filter
You can enter a filtering SQL condition (like in the WHERE clause) in the <Filter criteria> field.
Using the Filter by action
To filter a table according to a cell value, click this cell and select Filter by from the context menu.
Using the Find action
To search through the code, use the Find action Ctrl+F.
You can tune a search scope and, for example, exclude comments and string literals from the search.
You can select a part of code and search through this part only.
Find in selection
You can search for a text string inside the multi-line selection.
Select a multi-line fragment and press Ctrl+F.
Click and type your search string. DataGrip will search for the target inside the selected fragment first.
If you release , DataGrip will switch the search process back to the whole file.
If you want to search for the multi-line fragment itself, select it and press Ctrl+F.
Using the Find in Files action
Find in Path Ctrl+Shift+F looks for code in other consoles, attached files and even in the source code of views and routines.
In our example, if you select Directory, DataGrip looks for
sakila only in the postgres-sakila-db folder that is attached to the project. But if you select Scope with the All Places option, DataGrip will also look in other folders (finds the search string in Oracle).
Using the Find usages action
Find usages Alt+F7 will show you where an object is used. It can be scripts or source codes of other projects. In our example, the actor table is found in dump files, database consoles with different queries and several objects: one rule and three views.
Navigate to a file
Find action Ctrl+Shift+A helps you to find this or that action. It also searches in settings, so Limit page size to setting can be found here as well.
For instance, if you forget how to open a new query console, press Ctrl+Shift+A, type
new query and press Enter.
Search everywhere is another useful feature that looks for any item in databases, files, actions, elements of the user interface, settings, and so on. In the following animation, when you type
actor, you see not only database objects, but also available actions (for example, Rename Shift+F6). The refactoring can be performed from the list with your search results.
Define the scope of Search Everywhere with the filter icon.
If you search for a table, you can also use the following actions:
- Open the table DDL
- Open the table data
- Open the Modify Table dialog
- Open the Select in popup
- Open the Quick documentation popup
- Open the SQL generator