📜 ⬆️ ⬇️

How to search in DataGrip



In working with any tool, it is important to easily find what you need. In DataGrip are looking for:

- Database objects : tables, views, functions, columns, etc.
- The data itself .
- Code , for example a piece of code in a script or source code of an object.
- Other : settings, actions, files.
')
We will understand how not to get lost in the IDE and its databases.

Database Objects


Any tree (as well as menus, lists, pop-ups) in the IDE on the IntelliJ platform supports a quick search: just type the name of what you need. Remember that an object will be found only if its node in the tree is revealed.

Abbreviations work: ' fa ' will find ' film_actor '.



Navigate to the base object by Ctrl + N ( Alt + O for OSX ). Type in the name or abbreviation of the base, schema, table, view, procedure.

If you are looking for a table or view, Enter will open the data editor (with the DDL tab if you need code), and F4 will show the object in the tree.

The same for functions and procedures: Enter will open the source in the editor, F4 will show the object in the tree.

image

A little trick for finding columns in a table or query result: open Structure view ( Ctrl / Cmd + F12 ) and start typing. A quick search will filter the desired columns. Enter will transfer focus to the desired column.



Data


Text search ( Ctrl / Cmd + F ) works in tables and query results. Suitable if you do not know in which particular column you need the data.



Data will be searched only on the current page. The number of lines per page is set in Settings → Database → Data views → Result page size . If you enter -1 , all lines will be displayed at once. But this may affect the speed of query execution.



When viewing data in a table, write out the filtering conditions in the text field above, as if writing SQL in the WHERE clause .



In this field, you can insert values ​​automatically from the context menu.



Code


Search works in any editor. But not even everyone in JetBrains knows that there is an automatic completion :) Called by Ctrl + Space and offers options from an open file.

In the settings, specify where to search: include or exclude lines, comments. You can put a multi-cursor on all search results: Ctrl + Alt + Shift + J ( Ctrl + Cmd + G for OSX ).



Search along the way searches for code in other consoles, files, and source codes of views, procedures, and functions.

In our example, if you select ' In Project ', the code will be found only in the dump file attached to the project. But if you select 'All scopes,' the same piece will be found in our base procedure.



Find usages in the context menu of the object (or Alt + F7 ) will show its use in queries, scripts or source codes of other objects. For example, the actor table is found in dump files, consoles, and several source codes: it is used in rules and views.



Rest


Ctrl + Shift + N ( Shift + Cmd + O for OSX ) will open the file by name.



In the settings also works a quick search. To find the Result page size , type this.



When you do not know how to do something , Find action will help ( Ctrl + Shift + A ). Here you can search for settings, but most importantly, look for any action in the IDE here. Not sure how to open a new console? Write Open new console .



And when it’s not at all clear where to look, try ' Search everywhere '. Database objects, actions, files, settings - everything can be found here. For example, ' actor ' showed not only objects from the database, but also the action ' Refactor ', which can be performed directly from here.



Icon in the form of a gear will help determine where to look.


If your searches have not been successful, write to us in the comments or on Twitter . We'll find!

DataGrip command

Source: https://habr.com/ru/post/327006/


All Articles