Working with the query editor
The query editor opens in the data panel when you select a database, a table, or a view in the
Running a query
To perform a database query, establish or activate a connection with the database.
To build a query:
-
Under Connections
, select a database, table, or image. -
In the data panel, you will see a form with the default query:
SELECT * FROM <table_name> LIMIT 10;
-
Use this query or edit it. The interface will suggest relevant parts of the query and highlight errors.
-
Click Run.
In the results panel, you will see a table with the query results.
When editing or running a query, you can use the following keyboard shortcuts (click
to see the full list):- Show suggestions: Ctrl + I , Ctrl + Space.
- Comment out a line: Ctrl + /.
- Run a query: Ctrl + Enter.
- Show suggestions: ⌘ + I , ⌃ + Space.
- Comment out a line: ⌘ + /.
- Run a query: ⌘ + ⏎.
Click
Note
A table with multiple rows may be difficult to view. Use the LIMIT
condition and extra conditions to cap the number of displayed rows.
You can view your executed queries in query history and save them as templates.
Exporting query execution results
To save the results in a format you like:
- Click Export in the top-right corner of the panel with the results table.
- Select the appropriate format:
JSON
,CSV
, orTSV
.
A file with the results will be added to your browser's downloads section.
Setting up the query editor
Yandex WebSQL enables you to quickly edit your queries, including with features, such as context help or SQL syntax and error highlighting. To manage these features:
- Click
Settings in the bottom-left corner. - Go to the Query editor section.
- Set up the editor theme (
Visual Studio
orHigh Contrast
), font size and type, and the editing features:- Editor tips
- Syntax highlighting
- Error highlighting
- Editor minimap
- Autoclosing of quotes
- Autoclosing of parentheses