DataGrip 2023.3 Help

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.

Database objects

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.

  1. 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.

    Speed search in a tool window
  2. (Only in Database Explorer) To toggle the Speed Search filter on and off, click the Speed Search filter button (the Filter button).

  3. If several items match the pattern, use the ArrowUp and ArrowDown keys to move between them. Press Enter to open the selected item. Press Escape to hide the search field.

Database objects in Search Everywhere

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.

Defining the scope of Search Everywhere

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 title bar.

In case you want to search for columns in a result set or table, invoke the File Structure action Control+F12 and start typing. Speed search filters columns automatically. Press Enter to navigate to the column that you need.

Data

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

  1. 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.

  2. Right-click the selection and select Tools | Full-Text Search. Alternatively, press Control+Alt+Shift+F.

  3. In the search field of the Full-text Search dialog, type your search request and click Search.

  4. 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 Alt+3.

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 Control+F. 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 Control+F.

Select the Filter rows checkbox to see only rows with found matches.

Quickly find data inside a table without writing a statement

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 Control+Alt+S and navigate to Database | Data Editor and Viewer Database | Data Editor and Viewer, and clear the Limit page size to checkbox.

Rows filter

You can enter a filtering SQL condition (like in the WHERE clause) in the WHERE field.

Filter rows

The Filter by action

To filter a table according to a cell value, click this cell and select Filter by from the context menu.

Automatically populate a field from the context menu

Code

The Find action

To search through the code, use the Find action Control+F.

You can tune a search scope and, for example, exclude comments and string literals from the search.

Include comments and literals

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.

  1. Press Control+F, click the Filter Search Results button (Search in Selection), and select Search In Selection.

  2. 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 Control+F.

    Find in selection

The Find in Files action

Find in Files Control+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 and MySQL directories).

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_id column is found in columns, database consoles with different queries, several objects, and in scratch files.

The Find Usages action

Other

To navigate to a file, press Control+Shift+N and enter the name of a file.

The Go to File dialog

Speed search in Settings dialog

Speed search works in settings as well. For example, open settings by pressing Control+Alt+S, and type Limit page size to into the search field.

Activate a speed search in settings

Find Action

Find Action Control+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 example, if you forget how to open a new query console, press Control+Shift+A, type new query and press Enter.

Find a shortcut for an action

Productivity tips

If you search for a table, you can also use the following actions:

Open the DDL

Control+B

Open the table data

F4

Navigate to the object in the Database Explorer

Alt+Shift+B

Open the Modify Table dialog

Control+F6

Open the Select in popup

Alt+F1

Open the Quick documentation popup

Control+Q

Open the SQL generator

Control+Alt+G

Search Everywhere

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.

Search everywhere

  1. 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 non-project related items.

    Search Everywhere popup
  2. 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 display Enter Presentation Mode in results.

    Synonyms in Search Everywhere

    DataGrip lists all of the found results where your query is found. Press Control+ArrowDown to jump to the bottom of the list for more... items or Control+ArrowUp to return to the top of the search results.

    Press Tab to switch the scope of your search to database objects, files, symbols, or actions.

    You can use the following shortcuts to open the search window with the needed scope right from the start:

    • Control+N: finds a database object by name.

    • Control+Shift+N: finds any file or directory by name (supports CamelCase and snake_case).

    • Control+Alt+Shift+N: finds a symbol.

      In this case, the search scope will include columns, indexes, and other objects.

    • Control+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 button (Filter) 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.

Exclude file types from search

To see the results of your search in the Find tool window, click the Open in Find Tool Window button (the Open in Find tool window icon) on the window toolbar. This button is disabled when you search in the Actions tab.

Search for settings and plugins

You can search for a list of settings, their options, and plugins that you can quickly access, enable, or disable.

  1. Press Shift twice to open the search window and type /. DataGrip lists the available groups of settings.

  2. Select the one you need and press Enter.

    Search for Settings

    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.

Search for abbreviations

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.

  1. In the Settings dialog (Control+Alt+S), go to Keymap. From the options on the right select Other | Show Color Picker.

  2. From the context menu, select Add abbreviation.

    Color Picker Add Abbreviation
  3. In the dialog that opens, specify the abbreviation you are going to use, for example, cp and click OK.

  4. Press Shift twice to open the search window.

  5. When you type cp in the search field, DataGrip will display the item to which you've assigned your abbreviation. Press Enter to access the Color Picker dialog.

    Search Results

Evaluate mathematical expressions

You can quickly type and evaluate simple mathematical expressions.

  1. Press Shift twice to open the search window.

  2. Enter an expression you want to evaluate, DataGrip will display the answer in the search results.

    Evaluate expression

    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. 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.

  1. Press Control+Alt+S to open the IDE settings and then select Advanced Settings.

  2. Scroll down to the Search Everywhere section and disable Show text search results in Search Everywhere.

  3. Apply the changes and close the dialog.

Filter search results by a data source

  1. In the Search Everywhere dialog, click the Database tab.

  2. From the All Places list, select a scope that you want to use as a filter.

    Filter search results by a data source

Quick navigation from the Search Everywhere dialog

For a quick navigation from the Search Everywhere dialog, consider using the following shortcuts:

Go to the table DDL

Select an object and press shortcut Control+B.

Jump to source

Select an object and press shortcut F4.

Modify a table

Select a table and press shortcut Control+F6.

Select an object in the preferred view

Select an object and press shortcut Alt+F1.

Open quick documentation

Select an object and press shortcut Control+Q.

Open the SQL generator

Select an object and press shortcut Control+Alt+G.

Productivity tips

Search in context of a data source

  • 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.

    Context Data Sources
Last modified: 22 September 2023