Running queries

Console behavior

Schema switcher

Create multiple consoles to manage lots of queries at the same time. Each console has a schema switcher.

Executing options

DataGrip provides smart options for executing. When the cursor is inside a query, the execution can be customized with several possible options. Define its intended behavior: execute the smallest statement, the largest statement, ask you to choose what to execute, or execute the whole script.

Smallest statement

Largest statement

Ask what to execute

If the cursor is outside of any statement, you can configure it to execute the whole file, to execute all statements to the end of the file, or to do nothing.

Whole script

Everything below caret

Nothing

Execute selection

Select some code and execute only that selection. Note that the selected query is run as is: DataGrip just sends this string to the database and gets the result. It can be useful when the IDE incorrectly detects errors in queries.

Local history

Each console has Local History so you will never lose your code. Compare changes in Diff Viewer and revert to the one you need.

Structure view

For each console or SQL file you have a pop-up where all statements are submitted as a structure. You can run queries just from this Structure pop-up which will be useful when you need to run several of them in a big script.

Query result

Result-set

In DataGrip the result-set is modifiable, so that you can change data just after you get it via executing the query. It is the similar to the table editor with the same options available including auto-commit, adding/deleting rows, text search, and data navigation.

Compare results

Two result-sets can be compared in Diff Viewer. DataGrip will highlight the differences and let you manage the comparison criteria via the Tolerance parameter. For instance, if you want to consider two rows as equal if their data differ in a single column only, enter the corresponding value in the Tolerance field. Any column can be excluded from the comparison if needed.