Query Editor
This page is part of MariaDB's Documentation.
The parent of this page is: Connect and Query
Topics on this page:
Overview
Query Editor allows you to run queries directly in the browser to interact with data stored in SkySQL databases.
Prerequisite
Enterprise Server With Replica(s)
Xpand Distributed SQL
ColumnStore Data Warehouse
Access to Query Editor
To access Query Editor:
Log in to the Portal.
Launch a compatible database service.
Click "Workspace" in the main menu (left navigation in the Portal).
On the Workspace page, click the "Explore" button on the Query Editor card.
Alternatively, Query Editor can be accessed from the Dashboard by clicking on the service name of the desired service, then clicking on the "Query Editor" tab.
If your IP address or netblock has not yet been added to the Firewall allowlist, you will be prompted to do so.
With the cursor active on the editor, press the F1 key to view available commands.
Data Preview
To preview data:
In the left sidebar, click the database name then click tables.
Hover on the table name then left-click to show "Preview Data".
Right-click to choose either "Preview Data" or "View Details" to generate data.
After modifying the schema (performing DDL), the left sidebar (Schemas) must be manually refreshed. To refresh the sidebar, click the Reload button to the right of the "Schemas" label.
Tab Interface
Query Editor features worksheet tabs. The default worksheet is "Query Tab 1".
Each worksheet is bound to a separate database connection.
Additional worksheets can be added using the "+" button to the right of the last worksheet tab.
Worksheets can be removed using the "X" button to the right of the worksheet tab label.
Editor Interface
Statements are entered into the editor interface, or can be loaded from file by clicking the Open Script icon above the editor text box.
Statements in the editor interface can be saved to file clicking the Save Script As icon above the editor text box.
To save statements within Query Editor for use later, click Create A Query Snippet icon above the editor text box.
Icons in the upper-right corner of the editor text box enable changes to Settings, and to minimize or maximize the editor text box.
Run SQL Statements
To access run SQL statements in Query Editor:
Choose an existing database and table from the left sidebar.
Write a SQL statement in the editor.
Click the "run" button to execute all statements.
Check your statements in the pop up window. Press the "Run" button to execute the statements.
View the Results
After running a SQL statement, you can view the query results.
A visual table with your queried data is created in the Results tab. To view the table:
Click the "Results" tab under the Query Editor.
Check the table in the "Results" tab.
To filter the table data, click the "Filter By" button and select desired filters.
To filter columns, click the "Columns" button and select desired filters.
To export results, click the arrow down button on the bottom right.
View a Data Visualization
To view data visualizations:
Click the "Show Visualized Configuration" button in the query editor bar.
The visualizations are shown in the right sidebar. Select the desired graph type.
Select result set.
Query Configuration
Query Configuration allows you to set row limits and query history retention period.
To set row limit and retention period:
Click the "gear" icon in the Query Editor page (upper right).
Select row limit.
Enter query history retention period in days.
Click the "Save" button.
History
History tracks executed SQL statements.
User query logs contain queries written in the SQL editor.
Action logs contain queries for SQL generated by Query Editor. Action logs include Preview Data (top 1000), View Details, Drop Table, and Truncate Table.
To view History in table form:
Click the "HISTORY" button under the "History/Snippets" tab
To filter results by search, enter a value in the search bar.
Click the "Filter By" button. Select desired filter option ("User query logs" or "Action logs").
To filter log types, click the "Log Types" button. Select desired logs.
The displayed columns can be customized by clicking the Filter Columns icon in the upper-right corner above the history table.
History data can be exported to file by clicking the Export Results icon in the upper-right corner above the history table. Data is written in either CSV (optionally with custom delimiters) or JSON.
Vertical mode can be enabled by clicking the Vertical query result button.
Snippets
Snippets are SQL statements saved within the Query Editor.
Statements can be saved as a Snippet using the Create A Query Snippet icon above the editor text box.
To view Snippets in table form:
Click the "SNIPPETS" button under the "History/Snippets" tab
To filter results by search, enter a value in the search bar.
Click the "Filter By" button. Select desired filter option.
Click the "Edit" button to edit existing snippets.
Snippets can be exported to file using the Save Script button. This feature requires use of Google Chrome or a Chromium-based browser.