# Code editor tips and reference

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/llms.txt).

<a id="changing_dialect"></a>

Procedure: Change the SQL dialect in the code editor

> **Note:**
> SQL dialect is defined by the attached data source or schema. The dialect can only be changed for Oracle DBMS.

* Right-click the editing area and select Change Dialect (<current_dialect>) to. In the Change SQL Dialect window, select a dialect.

<a id="productivity-tips"></a>

## Productivity tips

<a id="view_history_of_a_query_file"></a>

Procedure: View history of a query console

* In a query console, right-click any area and select `Local History | Show History`.

For more information about local history of a file, refer to the [Local History](https://www.jetbrains.com/help/go/local-history.html.md) topic.

<a id="apply_a_code_style_in_the_editor"></a>

Procedure: Apply a code style in the editor

1. Right-click any area or a selection of code in the editor and select Reformat Code. Alternatively, press [Reformat Code shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ReformatCode").

2. Select the scope.

3. Click Run.

![Apply a code style in the editor](https://resources.jetbrains.com/help/img/idea/2026.3/db_apply_a_code_style_in_the_editor.png)

<a id="view-the-file-path-of-a-query-console"></a>

Procedure: View the file path of a query console

* To see the details of a file, hover over the query console tab.

<a id="navigate-to-a-console-file-from-the-select-in-window"></a>

Procedure: Navigate to a query console from the Select In window

* Press [Select In… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "SelectIn"), select Project View and press [Enter shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter").

![Navigate to a query console  from the Select In window](https://resources.jetbrains.com/help/img/idea/2026.3/navigate_to_console_from_select_in.png)

<a id="edit_data_for_insert"></a>

Procedure: Edit data in INSERT statements as a table

1. Select `INSERT` statements that you want to edit.

2. Right-click the selection and click Edit as Table.

![Edit data in INSERT statements as a table](https://resources.jetbrains.com/help/img/idea/2026.3/db_edit_insert_statement_as_table.png)

3. In the table editor that opens, make necessary changes in the table cell. Press [Enter shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter") to confirm.

<a id="reference"></a>

## Reference

<a id="context_menu"></a>

### Context menu

In the code editor context menu, use the following actions to increase your productivity:

Duplicate
: (Query consoles only) Creates a copy of the query console.

![](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.table.svg) Edit as Table
: In `INSERT` statements, opens the editor for working with the data in a table format.

Change Dialect (<CurrentDialect>)
: (Oracle only) Change the SQL dialect. Select a dialect from the list.

Explain Plan | Explain Plan
: Shows an [execution plan](https://en.wikipedia.org/wiki/Query_plan) (or explain plan) for the current statement. The result is shown in a mixed tree/table format on a dedicated Plan tab.
:
:
:
: To [build a diagram of
: the execution plan](https://www.jetbrains.com/help/go/query-execution-plan.html.md#visualize_query_plan), click ![the Show Diagram icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.fileTypes.diagram.svg) Show Diagram on the left of the Plan tab, or press [ShowUmlDiagram shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ShowUmlDiagram").
:
:
:
: To build a flame graph, click ![the Flame Graph icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.SQLGroupByType.svg) Flame Graph.

Explain Plan | Explain Analyse
: Executes the statement and then shows an [execution plan](https://en.wikipedia.org/wiki/Query_plan) (or explain plan) for it.

![the Execute icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) Execute [Execute Current Statement in Multiline Console shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "Console.Execute.Multiline")
: Execute the current statement or the sequence of selected statements.

![the Execute icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) Execute Selection as Single Statement
: For a code selection, execute the chunk of code as a single SQL statement.

![the Execute to File icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) Execute to File
: Execute the current statement and save results in a text file. Select the output format and specify the file location and name.

Run 'query file' [Run context configuration shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "RunClass")
: (Query files only) Execute all the statements in the query file.

Attach Data Source
: (Query files only) Attach one of the existing data sources to the query file.

Switch Data Source
: (Query files only) For a query file with an attach data source, attach another data source.

`Diagrams | Show Diagram…` [ShowUmlDiagram shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ShowUmlDiagram")
: Opens a diagram in a separate editor tab.

`Diagrams | Show Diagram Popup…` [ShowUmlDiagramPopup shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ShowUmlDiagramPopup")
: Opens a diagram in a popup.

<a id="toolbar_controls"></a>

### Toolbar controls

| Icon | Action and shortcut | Description |
| --- | --- | --- |
|  ![the Execute button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg)  |    Execute   [Execute Current Statement in Multiline Console shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "Console.Execute.Multiline")  |     Execute selected SQL statement or statements.     If nothing is selected, the current statement is executed.     |
|  ![the Explain plan icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.consoleShowPlan.svg)  |    Explain Plan    |    Open the Explain Plan actions menu.       For more information about functionality, refer to  the [Query execution plan](https://www.jetbrains.com/help/go/query-execution-plan.html.md) topic.     |
|  ![the Browse Query History button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.history.svg)  |     Browse Query History   [Browse Query History shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "Console.History.Browse")  |     Open a dialog that shows all the statements that you have run for the corresponding data source.       See also, [Use the Query History dialog](https://www.jetbrains.com/help/go/run-a-query.html.md#use_the_query_history_dialog).       |
|  ![the View Parameters button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.viewParameters.svg)  |    View Parameters    |     Open or close the Parameters dialog.        For more information about user parameters, refer to  the [Run queries](https://www.jetbrains.com/help/go/run-a-query.html.md#user_parameters) topic.     |
|  ![the Open Query Execution Settings button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.settings.svg)  |    Open Query Execution Settings…    |     Open the  `Tools \| Database \| Query Execution` section of the Settings dialog to view or edit the query execution settings.      For more information about these settings, refer to [Query Execution](https://www.jetbrains.com/help/go/query-execution.html.md).    |
| ![](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.editorOutput.svg) | In-Editor Results |    Toggle the display of query result within the code editor of query console.        For more information about the in-editor results, refer to  [In-Editor Results](https://www.jetbrains.com/help/go/viewing-query-results.html.md#in_editor_results).     |
| ![Transaction mode](https://resources.jetbrains.com/help/img/idea/2026.3/buttonTransactionControlDB.png)     | Transaction Mode     and     Transaction Isolation    |    Select the [isolation level](https://en.wikipedia.org/wiki/Isolation_(database_systems)) for database transactions and the way the transactions are committed.       * Auto: the current transaction is committed automatically when you submit your local changes to the database server.    * Manual: the changes submitted to the database server are accumulated in a transaction that can either be committed or rolled back explicitly by means of ![the Submit and Commit icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.commit.svg) Submit and Commit or ![the Roll Back button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.rollback.svg) Roll Back buttons on the toolbar.      For more information about database transaction modes and isolation, refer to [Submit changes to a database](https://www.jetbrains.com/help/go/submitting-and-reverting-changes.html.md).     |
|     ![the Commit icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.commit.svg)    |     Commit    |     (For the Manual transaction mode.)  Commit the current transaction. This button is available only for the manual transaction mode. See also, [transaction mode and                     isolation](https://www.jetbrains.com/help/go/submitting-and-reverting-changes.html.md).     |
|    ![the Roll back icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.rollback.svg)  |       Roll back     |  (For the Manual transaction mode.) Roll back changes. This button is available only for the manual transaction mode. See also, [transaction modes and isolation](https://www.jetbrains.com/help/go/submitting-and-reverting-changes.html.md).  |
|     ![the Cancel Running Statements icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.stop.svg)          |  Cancel Running Statements    [Stop shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "Stop")  |  Terminate execution of the current statement or statements.   |
| ![Playground](https://resources.jetbrains.com/help/img/idea/2026.3/button_resolve_mode_db.png) |    File Resolve Mode    |          Select the resolve mode to manage the context that database objects in your code are resolved to.        * Playground: default mode for query consoles. All the database objects are resolved to the same context.    * Script: default mode for local SQL files. The `USE` SQL statement (`SET search_path TO` for PostgreSQL) overrides the default context that the database objects are resolved to.      For more information about the resolve modes, refer to [Resolve modes](https://www.jetbrains.com/help/go/run-a-query.html.md#resolve_modes).          |
| ![the Enable DBMS_OUTPUT icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.dbmsOutput.svg) | Enable DBMS_OUTPUT |     (Oracle and IBM Db2 LUW only) Toggles `DBMS_OUTPUT` for the query console.     |
| ![the Role and warehouse icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin-frontend.icons.expui.roleWarehouseSwitcher.svg) <default>    |    Select role and warehouse   |     (Snowflake only) Select the role and warehouse for the query console.     |
| ![the Switch current schema icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.schema.svg) <schema>    |    Switch current schema   |    Select the default schema or database. For PostgreSQL, Amazon Redshift, and Greenplum use the <schema> list to form the schema search path.       For more information about about default schemas, refer to  [Set the default schema](https://www.jetbrains.com/help/go/schemas.html.md#set_the_default_schema).     |
| ![the Switch attached data source icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.dbms.svg) <data source>    |    Switch attached data source   |     (Query files only) Select the data source to use for the query file.     |

