Open in Editor

Open in Editor is the button in a popup's query editor that sends the current SQL to the Editor, where it opens in a new console. Use it to keep working on the query there, with the console's saving and history.

Where the button appears

It sits in the popup's editor header, beside the other query actions, such as Copy. Its tooltip reads Open in Query Editor.

Send a popup query to the Editor

  1. Open the popup and go to its query editor.
  2. Write or edit the SQL. The button stays greyed out until the query has text.
  3. Click Open in Editor.

The popup minimises, and the query opens in the Editor, in a new console. The console takes the name of the item you came from, such as the view, the transformation or the writeback table. When the item has no name yet, the console is called New Console, and when one of your open consoles already has that name, the Editor adds a number to it.

You land on the new console, and a Console created message shows its name. From there it behaves like any other console: it saves on its own and keeps its history. See Consoles, saving and history.

Note

The hand-off goes one way. The popup keeps its own copy of the query, and edits in the console do not travel back. To reuse an improved version, copy it back into the popup.

Who can use the button

The button shows only for people who can open the Editor: your role needs Execute Query or Add/Remove Consoles in the Query Editor category. These are the same permissions that show Editor in the sidebar, so people without either never see Open in Editor at all. For the presets that include them, see Editor.

Questions, answered

Why can't I see Open in Editor in the popup?

Your role needs Execute Query or Add/Remove Consoles in the Query Editor category. Without either, the button is not shown at all. These are the same permissions that open the Editor; ask an administrator to add one of them to your role.

Why is the button greyed out?

The query is empty. Write or paste the SQL first; the button becomes clickable as soon as the query has text.

What is the new console called?

It takes the name of the item you came from: the view, the transformation or the writeback table. If that name is empty, the console is called New Console, and if one of your open consoles already has the name, the Editor adds a number to it.

Does clicking the button run the query?

No. It only sends the SQL to the Editor and opens the console. Nothing runs until you run it there.

Do my edits in the Editor come back to the popup?

No. The hand-off works one way: the popup keeps its own copy, and work you do in the console stays in the console. To use an improved version in the popup, copy it back from the Editor.

What happens to the query's parameters?

The SQL is handed over exactly as written, so {name:Type} placeholders stay in it and arrive as parameters you can fill in the Editor. See Query parameters.

Did the popup close when I clicked the button?

No. The popup is minimised, not closed, and the query stays in it.

Is this the same Open in Editor I see on a running query?

The label matches, but those buttons follow their own rules and console names: see Running queries for the instance on ClickHouse activity, and Query Management for the one in the query log.