Search in DataGrip
When working with a software tool, searching tends to be a very popular and frequently-used feature that is crucial to a good user experience. In DataGrip, you can look for things like:
Database objects: tables, views, procedures, columns, and other objects.
Data: full-text search and row filters.
Code: code usages in consoles, attached files, views, and routines.
Other things: files, settings, IDE actions, and other things.
The IDE also has a single entry point for looking for everything — Search Everywhere.
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 additional_country
.
Start typing the database object name, for example, the name of a table. As you type, a 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.
For the Database Explorer, a Speed Search filter is also available.
(Only in Database Explorer) To toggle the Speed Search filter, click Speed Search Filter.
If several items match the pattern, use the 0↑ and 0↓ keys to move between them. Press Enter to open the selected item. Press Esc to hide the search field.
Search Everywhere is another useful feature that looks for any item in databases, files, actions, elements of the user interface, settings, and so on. To open the Search Everywhere window, press Shift twice. For more information about the feature, refer to Search Everywhere.
To define the scope of Search Everywhere, use the filter icon.
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 to see an object in the database tree, select the Autoscroll from Editor option in the Options menu in the Database Explorer header.
In case you want to search for columns in a result set or table, invoke the File Structure action CtrlF12 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.
In the Database Explorer (View | Tool Windows | Database Explorer) , 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 Tools | Full-Text Search. Alternatively, press CtrlAltShift0F.
In the search field of the Full-text Search dialog, type your search request and click Search.
In the Find tool window, review search results. To open a database object, double-click it. To return to the Find tool window (View | Tool Windows | Find), press Alt03.
For more information about the full-text search, refer to Full-text search in databases.
To quickly find data inside a table without writing a statement, call up a text search with the Find action Ctrl0F. It is especially helpful if you do not know what column contains the data that you are looking for.
To automatically populate the search field with a search value from a certain cell, select the cell with it and press Ctrl0F.
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 CtrlAlt0S and navigate to Database | Data Editor and Viewer. Database | Data Editor and Viewer, and clear the Limit page size to checkbox.
You can enter a filtering SQL condition (like in the WHERE
clause) in the WHERE
field.
To filter a table according to a cell value, click this cell and select Filter by from the context menu.
To search through the code, use the Find action Ctrl0F.
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.
You can search for a text string inside a multi-line selection.
note
DataGrip handles replacing in multi-line selections the same way.
Press Ctrl0F, click the Filter Search Results button (), and select Search In Selection.
Select a multi-line fragment and type your search string. DataGrip will search for the target inside the selected fragment.
If you want to search for the multi-line fragment itself, select it and press Ctrl0F.
Find in Files CtrlShift0F looks for code in other consoles, attached files and even in the source code of views and routines.
For more information about the action, refer to the Search and replace content in files topic.
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 and MySQL directories).
Find Usages AltF7 will show you where an object is used. It can be scripts or source codes of other projects. In our example, the actor_id
column is found in columns, database consoles with different queries, several objects, and in scratch files.
For more information about the action, refer to the Search for usages topic.
To navigate to a file, press CtrlShift0N and enter the name of a file.
Speed search works in settings as well. For example, open settings by pressing CtrlAlt0S, and type Limit page size to
into the search field.
Find Action… CtrlShift0A 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 example, if you forget how to open a new query console, press CtrlShift0A, type new query
and press Enter.
If you search for a table, you can also use the following actions:
You can find any item in the project or outside of it by its name. You can search for any item of the source code, databases, files, actions, symbols, settings, UI elements, and anything in Git from a single entry point.
The following video gives a short overview of search everywhere functionality in DataGrip.
note
In the video, the DataGrip user interface is Classic UI. Starting from version 2023.1, the New UI is available. For more information about the New UI, refer to the corresponding topic.
In the main menu, go to Navigate | Search Everywhere or press Shift twice to open the search window. By default, DataGrip displays the list of recent files.
Pressing double Shift again or Alt+N for mnemonics will select the Include non-project items checkbox and the list of search results will extend to external items.
If you switch to other tabs, select the All Places to extend the search results to non-project items.
Start typing your query. You can use synonyms in your search. For example, typing
toggle presentation mode
to search for the presentation mode action will displayEnter Presentation Mode
in results.DataGrip lists all the found results where your query is found. Press Ctrl0↓ to jump to the bottom of the list for
more...
items or Ctrl0↑ to return to the top of the search results.Press Tab to switch the context of your search to classes, files, symbols, actions, and so on.
You can use the following shortcuts to open the search window with the needed scope right from the start:
Ctrl0N: finds a class by name.
CtrlShift0N: finds any file or directory by name (supports CamelCase and snake_case).
note
If you have a directory or a file that you excluded from your project, DataGrip will not include it in the search process.
CtrlAltShift0N: finds a symbol.
In this case, the search scope will include columns, indexes, and other objects.
CtrlShift0A: 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 button () 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. And if you are on the Database tab, you can select data sources that you want to include or exclude from the search.
To see the results of your search in the Find tool window, click the Open in Find Tool Window button () on the window toolbar. This button is disabled when you search in the Actions tab.
You can search for a list of settings, their options, and plugins that you can quickly access, enable, or disable.
Press Shift twice to open the search window and type
/
. DataGrip lists the available groups of settings.Select the one you need and press Enter.
As a result, DataGrip gives you quick access to the selected setting and its options.
You can also search for plugins and enable or disable them. Type
/plugins
in the search field, in the list of the search results use ON/OFF control keys to enable or disable the needed plugin.Other tags include
/appearance
,/system
,/inspections
,/registry
,/intentions
,/templates
, and/vcs
.
You can assign a short code for the action and use it to search for such action and quickly access it. For example, assign an abbreviation for Color Picker.
In the Settings dialog (CtrlAlt0S) , go to Keymap. From the options on the right, select Other | Show Color Picker.
From the context menu, select Add abbreviation.
In the dialog that opens, specify the abbreviation you are going to use, for example, cp and click OK.
Press Shift twice to open the search window.
When you type cp in the search field, DataGrip will display the item to which you have assigned your abbreviation. Press Enter to access the Color Picker dialog.
You can quickly type and evaluate simple mathematical expressions. DataGrip also supports HEX, binary, and octal expressions.
Press Shift twice to open the search window.
Enter an expression you want to evaluate, DataGrip will display the answer in the search results.
You can use basic arithmetic operators —
+
,-
,*
,/
, as well as^
for power — and basic math functions:sqrt()
,sin()
,cos()
,tan()
.
The text search is available by default within the Text tab. Within this tab, you can search for text queries, matching words, including case-sensitive scopes, and regex.
The text search results are also available on the All tab at the bottom of the list. They are displayed when there are few or no other search results available for a given query. You can disable the text search at any time through Advanced Settings.
Press CtrlAlt0S to open settings and then select Advanced Settings.
Scroll down to the Search Everywhere section and disable Show text search results in Search Everywhere.
Apply the changes and close the dialog.
In the Search Everywhere dialog, click the Database tab.
From the All Places list, select a scope that you want to use as a filter.
You can filter the search results by database object types. To do that, you can either use a tab filter, or the input field commands.
Using a tab filter:
Press Shift twice to open the search window and open the Database tab. Alternatively, press Ctrl0N.
Click Filter in the upper-right corner of the popup.
In the popup window that opens, select the database object type categories that you need in search results. Categories include the following objects:
Databases & Schemas
Tables
Scripting
Types
database
external-database
external-schema
schema
table
view
materialized-view
virtual table
foreign-table
and so on
function
stored procedure
aggregate
package
partition-function
and so on
alias-type
collection-type
object-type
table-type
Using the input field commands:
Press Shift twice to open the search window and open the Database tab. Alternatively, press Ctrl0N.
To find all database object of the same type, enter
/<database_object_type>
(in plural form). For example,/tables
.As a result, DataGrip gives you a list of all introspected database objects of the type you are looking for.
To find a certain database object of the type, add the database object name as follows:
/<database_object_type> <database_object_name>
. For example,/tables film
.Select the database object you need and press Enter.
For a quick navigation from the Search Everywhere dialog, consider using the following shortcuts:
To search for an object in context of the data source that you work with, select Context Data Sources from the All Places list. The filter is available for Database, Files, and Symbols tabs.
The context is defined according to the console that you use, the data editor, or a data source that you selected in the Database Explorer. If you select several data sources, the search is performed in all of them.
Thanks for your feedback!