Skip to content

SQL Editor

dbeaver-devops edited this page Jan 31, 2025 · 17 revisions

Table of contents

With the SQL Editor in CloudBeaver, you can write and execute multiple SQL scripts within a single database connection, save them as files, and reuse them later.

Getting started

To start working with the SQL Editor, you have two options:

  1. Create a new SQL script:
    • click Open SQL Editor button in the top toolbar.

For more information about toolbar, see Toolbar in CloudBeaver.

  1. Open recent SQL script:
    • Select Tools -> Show scripts from the top toolbar.
    • A Resource manager window appears. Click any script to open it in a new tab. For more information see Resource manager.

SQL Editor overview

The SQL Editor contains the Script panel, the Result panel, and the Toolbar.

Script panel

The Script Panel is the primary area where you can write, edit, and manage your SQL scripts. It provides basic text editing features with the added benefits of specialized functionalities tailored for SQL development:

Results Panel

The results panel displays tabs with results in various formats. The tabs resulting from script execution represent instances of the Data Editor. You can create, edit and execute SQL scripts in the script panel and then see the results in the result tabs.

Toolbar

The Toolbar in the SQL Editor is equipped with various buttons:

Button name Icon Description Additional resource
Execute SQL statement Executes the SQL statement.
Execute SQL statement in new tab Executes the SQL statement in a new tab.
Execute SQL script Executes all SQL statements in the script panel.
Explain execution plan Provides a detailed explanation of the SQL execution plan. Query Execution Plan
Show server output Displays the server-side output, specific to the database being used.
AI prompt Generates SQL code based on natural language prompts. AI Smart Assistance
Save as script Saves the current SQL script to a file. Saving Scripts
Format SQL script Formats the SQL script. Formatting Guide
Download SQL script Downloads the SQL script to the local machine.
Upload SQL script Uploads a SQL script from your local machine to the SQL Editor.

Statement Execution

Place the cursor on the line with the statement or select part of the script to execute the statement. Click on the Execute SQL statement icon in the left toolbar or use the Ctrl+Enter shortcut. The result of the statement execution will be shown under the script editor area. Results will be grouped (Result - 1 <1>, Result - 1 <2>) if statement execution is finished with more than one result.

Script Execution

Click on the Execute SQL script icon in the left toolbar or use the Alt+X shortcut to execute the script. The summary result will be shown in the Statistics tab, and results will be shown in separate Result tabs.

Resource manager

To manage SQL scripts on the server, use the Resource Manager. For a more detailed guide on using this feature, see Resource Manager.

Auto and Manual commit

By default, all database connections in the SQL Editor operate in Auto-commit mode.

See more information on Auto and Manual commit modes.

SQL Editor preferences

To configure the SQL Editor, navigate to Settings -> Preferences or Settings -> Administration -> Global Preferences.

Setting Description
Insert table aliases (in FROM clause) Controls how aliases are inserted. Options:
Disable: No aliases will be automatically inserted.
my_table mt: Inserts the alias mt for the table my_table.
my_table AS mt: Inserts AS mt explicitly as the alias.
Use long object names (schema/catalog) Includes schema or catalog details in table names for clarity.

Shortcuts

You can use keyboard shortcuts to speed up your work in the SQL Editor. See the full list in the Shortcuts article.

CloudBeaver Documentation

User Guide

Installation

Configuration

CloudBeaver AWS

CloudBeaver Enterprise Edition

Deployment

Clone this wiki locally