-
Notifications
You must be signed in to change notification settings - Fork 474
SQL Editor
- Getting started
- SQL Editor overview
- Query execution
- SQL Editor features
- SQL Editor preferences
- Shortcuts
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.
To start working with the SQL Editor, you have two options:
-
Create a new SQL script:
- click Open SQL Editor button in the top toolbar.
For more information about toolbar, see Toolbar in CloudBeaver.
-
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.
Note: A connection is created when you open the first SQL editor tab. Additional tabs for the same database reuse that connection.
The SQL Editor contains the Script panel, the Result panel, and the Toolbar.
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:
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.
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. | Server Output |
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. |
You can change the connection linked to the current SQL editor or switch the active database/schema from the main toolbar, without losing your SQL query.
-
To change the connection, click Active datasource, then select the required connection from the connections tree.
-
To change the active database or schema, click Active catalog/schema, then select the required schema from the dropdown list.
Tip: To quickly link the SQL editor to the connection currently in focus in the Database Navigator (any object in the connection-table, folder, etc.), click Link with editor
or press CTRL + SHIFT + , (CMD + SHIFT + , for macOS).
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 button () in the left toolbar or use the 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.
Tip: To view results in a separate tab, click Execute SQL statement in a new tab (
) instead. This opens the result in a new tab below the editor.
Click on the Execute SQL script button () in the
left toolbar or use the shortcut to execute the script. The summary result will be shown in the
Statistics tab, and results will be shown in separate Result tabs.
Click Explain execution plan button () or use the shortcut to
view the query plan if supported by the driver.
See Query execution plan for details.
SQL Assist suggests SQL keywords, object names, and code snippets as you type.
Read more in SQL Assist and auto-complete.
When many tabs are open, show them in multiple rows instead of scrolling:
-
Go to Profile -> Preferences -> Interface
-
Turn on the Multiple rows for tabs checkbox
Tip: Use this to avoid horizontal scrolling when many tabs are open.
To manage SQL scripts on the server file system, use the Resource Manager.
By default, all database connections in the SQL Editor operate in Auto-commit mode.
See more information on Auto and Manual commit modes.
To configure the SQL Editor, navigate to Settings -> Preferences or Settings -> Administration -> Settings.
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. |
You can use keyboard shortcuts to speed up your work in the SQL Editor. See the full list in the Shortcuts article.
-
Getting started
-
Administration
- Server configuration
- Create Connection
- Access Management
-
Authentication methods
-
Local Access Authentication
- Anonymous Access Configuration
- Reverse proxy header authentication
- LDAP
-
Single Sign On
-
SAML
-
OpenID
-
AWS OpenID
-
AWS SAML
-
AWS IAM
-
AWS OpenId via Okta
-
Snowflake SSO
-
Okta OpenId
-
Cognito OpenId
-
JWT authentication
-
Kerberos authentication
-
NTLM
-
Microsoft Entra ID authentication
-
Google authentication
-
Local Access Authentication
- Database authentication methods
- Network configuration settings
- User credentials storage
- Cloud databases configuration
-
Query Manager
-
Drivers Management
-
Features
- Server configuration
-
Domain manager
- Product configuration parameters
- Command line parameters
- Log customization
- Local Preferences
- API and Integration
- Deployment options
- Additional setup and management