How to search in DataGrip



    When working with any tool, it is important to easily find what you need. In DataGrip they look 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.

    Let's see how not to get lost in the IDE and our databases.

    Database Objects


    Any tree (as well as menus, lists, pop-ups) in the IntelliJ IDE 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 expanded.

    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 database, 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 to find 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 focus on 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 the data you need.



    Data will be searched only on the current page. The number of rows 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 can affect the speed of query execution.



    When viewing data in a table, write down the filtering conditions in the text field at the top, as if you were writing SQL in the WHERE clause .



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



    The code


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

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



    A search along the path searches for code in other consoles, files, and in the source code for 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 the procedure of our database.



    Find usagesin the context menu of the object (or by 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.



    A quick search also works in the settings . To find the Result page size , type this.



    When you don’t 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 here in the IDE. Not sure how to open a new console? Write Open new console .



    And when it’s completely unclear 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' Refactor ' action , which can be performed right from here.



    The gear icon helps you determine where to look.


    If your searches were unsuccessful, write to us in the comments or on Twitter . We'll find!

    DataGrip Team

    Also popular now: