Working with SQL Editor
Opening a connection via SQL Editor
You can open a connection in SQL Editor in two ways:
- In the left-hand panel, select
SQL Editor. - From the list that opens, select the required connection.
- Open the required connection.
- In the top-right corner of the connection page, click Open in SQL Editor.
This will open a window for data operations and queries.
Running a query
To run an SQL query:
- Select the required connection from the list in the SQL Editor.
- In the data panel, enter your SQL query. The editor will highlight errors and provide auto-complete suggestions as you type.
- Click Execute.
In the results panel, you will see a table with the query results.
You can use the following hotkeys when editing or running a query (click
- Display suggestions: Ctrl + I, Ctrl + Space.
- Add a line comment: Ctrl + /.
- Run the query: Ctrl + Enter.
- Display suggestions: ⌘ + I , ⌃ + Space.
- Add a line comment: ⌘ + /.
- Run the query: ⌘ + ⏎.
Viewing table contents without an SQL query
To get contents of a table or view without an SQL query, select the object in the connection structure. The editor will run a query automatically:
SELECT * FROM <table_name> LIMIT 100
Pagination
You can use pagination in SQL Editor to manage result outputs. With pagination, you can:
-
Switch between pages:
: First page. : Previous page. : Next page. : Last page.
-
Select the number of rows displayed per page. To do this, click the field with the number of rows (between the arrows) and select the appropriate limit.
-
Get the total number of rows by clicking Total rows.
Each action you take with pagination re-runs the query and is logged in the query history.
Multi-queries
SQL Editor supports multi-queries, enabling you to run multiple queries as a single batch.
Multi-query example:
SELECT * FROM <table_1_name> LIMIT 10;
INSERT INTO <table_2_name>;
To run individual subqueries within a multi-query, highlight one or more subqueries and click Run current query. SQL Editor will display the progress status for each highlighted query.