SQL Editor
SQL Editor is the browser-based workspace for exploring data and running SQL in a VeloDB Cloud warehouse. Use it to browse catalogs, databases, and tables, work in multiple query tabs, run a statement, inspect and download its results, and investigate a query when it needs tuning.
SQL Editor is the recommended starting point when you want to query a warehouse without configuring a separate SQL client. It is available for SaaS and BYOC warehouses.
Before you start
Before you open SQL Editor, make sure that:
- You can access the target warehouse in the VeloDB Cloud console.
- The warehouse has a cluster in Running state. SQL Editor cannot run statements when no compute cluster is running.
- Your warehouse SQL user has the required privileges for the catalog, database, and objects that you want to query or change.
SQL Editor executes statements against the warehouse selected in the console. Confirm the selected warehouse before you run a statement, especially when you work with multiple environments.
Note:
SQL Editor is a warehouse data-plane feature. If your organization routes console data-plane traffic through private connectivity, configure access to the warehouse-specific console endpoint before using SQL Editor. See Private connectivity to the warehouse-specific console endpoint.
Explore SQL Editor
To open SQL Editor, do the following:
- Log in to the VeloDB Cloud console.
- In the upper-left corner, select the warehouse that you want to query.
- In the left navigation pane, under Development, click SQL Editor.
When SQL Editor opens, it shows the Get started with SQL or sample data home page. The page provides use case demos for Real-time analytics and Observability, SQL templates for Complex Joins, Full Text Search, and Semi-Structured Data, and a Recent list when you have previously opened query tabs. Select a demo or template to begin, or use the + control to create a query tab.
The workspace keeps data discovery, query authoring, and reusable SQL together.
| Area | Use it to |
|---|---|
| Data | Search the selected catalog and database, then browse the available schemas, tables, and other objects. |
| Data > Catalog | Select the catalog that contains the data you want to use. |
| Data > Database | Limit the object browser to one database, or select All to browse databases in the selected catalog. |
| Saves | Reopen SQL Editor tabs that were saved automatically from the current or earlier sessions. |
| Templates | Start from a use case demo or SQL template instead of writing SQL from scratch. |
| Query tabs | Keep separate SQL tasks open, such as an exploratory query and a production-safe validation query. |
Use the search field in the Data panel to find an object by name. Select a catalog or database before browsing when you know the location of the data. Click Refresh after you create an object or when the object tree does not show a recent change.
You can run SQL in three ways: write a statement in a query tab, reopen a saved statement from Saves, or start from a template or demo in Templates. The following sections explain each option.
Run SQL statements in a query tab
Use a separate query tab for work that you may want to return to later. The following example is read-only and verifies that the selected warehouse can execute SQL statements.
-
In the Data panel, select the catalog and database that you want to use. You can also set the database in SQL with
USE <database-name>. -
Open a query tab, then enter a statement. For example:
SELECT 1 AS connection_test; -
To rename or delete a query tab, hover over its name, click the ellipsis (...) next to the name, then click Rename or Delete.
-
To make the statement easier to review, in the upper-right corner of the workspace, click the ellipsis (...), then click Format.
-
Click Run to run the statement and display the results below the editor.
-
Review the query status and result set before moving to another tab.
By default, Run applies a 1,000-row limit to query results. To remove this limit, in the upper-right corner of the workspace, open the Limit menu and select No limit before you run the statement. Start with the default limit when you are developing or validating a query, especially for queries that can return a large result set.
To download the query output without first browsing the result set, open the menu next to Run and select Run and Download.
Warning:
SQL Editor executes the statement that you submit. Review
INSERT,UPDATE,DELETE, DDL, and other write operations before running them, and confirm that the selected warehouse and database are correct.
Run saved SQL statements
SQL Editor saves your query tabs automatically. Use Saves to quickly return to SQL statements that you opened in the current session or a previous session.
-
Click Saves.
-
Use the search field to find a saved query from the current or an earlier session.
-
To organize saved queries, click the ellipsis (...) next to the search field, then select one of the following actions:
- New Folder: Create a folder for saved queries.
- Batch Delete: Select and delete multiple saved queries.
- Batch Move: Select and move multiple saved queries to a folder.
- Download: Download saved queries.
- Import Data: Import a local SQL script.
-
Select an entry to load its SQL statements into a query tab.
-
Review the catalog, database, and statement before you run it again.
Saved SQL statements are useful for iterative analysis and for retaining a working draft. Treat saved SQL as a convenience feature, not as a source-controlled deployment process. Store production SQL statements and schema changes in your version-control workflow.
Run a template or demo
The Templates tab provides starting points for common workloads. It includes use case demos such as Real-time analytics and Observability, as well as SQL templates such as Complex Joins, Full Text Search, and Semi-Structured Data.
- Click Templates.
- Select a use case demo or SQL template that matches your task.
- Read the template and any setup instructions before running it.
- Adjust the catalog, database, table names, and other values for your warehouse.
- Run the statement when it is safe to do so.
Templates help you learn SQL patterns, but they can reference sample data or require objects that do not exist in your warehouse. Do not assume a template is ready for a production dataset without reviewing it.
Work with query results
After a query succeeds, the results panel helps you inspect the returned rows without leaving SQL Editor.
- Use the search control in the results panel to filter the displayed rows.
- Click a column header to sort the displayed results.
- Select a cell to open the cell inspector and view the full value.
- Use the download control in the results panel to export the displayed results as a CSV file.
The results panel is intended for exploration and verification. For a completed-query record that you need to search, compare over time, or export with execution metadata, use Query Audit.
Investigate query execution
SQL Editor provides query history for the statements that you run from the workspace. To review a previously submitted statement:
- In the upper-right corner of the query results area, click Show query history.
- In the Query History panel, select the statement that you want to review.
When a Query ID is available, select it to inspect the query profile.
The profile page presents the execution plan in Graph and Text views. Use the graph to understand the operators and data flow, or use the text view when you need a compact representation. You can download the profile for later analysis.
Note:
Failed statements and statements that do not produce a query do not have a Query ID or query profile.
Use the right tool for the question you need to answer:
| If you need to | Use |
|---|---|
| Examine a query that is still running or terminate it | Sessions |
| Find completed queries across the warehouse and review execution metadata | Query Audit |
| Diagnose operators, scans, exchanges, and other query execution behavior | Query Profile Analysis |
Common issues
| Symptom | Likely cause | What to do |
|---|---|---|
| SQL Editor reports that no compute cluster is available. | The selected warehouse has no cluster that can run the query. | Open the warehouse's cluster management page, check the cluster status, and make a cluster available before retrying. |
| The Data panel does not show an expected catalog, database, or table. | The current catalog or database selection might not include the object. | Select the expected Catalog and Database, then click Refresh. If the object remains unavailable, confirm that your warehouse SQL user has access to it. |
| A query does not have a Query ID or profile. | The statement failed or did not produce a query. | Correct and rerun the statement if appropriate. Use Query Audit to investigate completed query records. |
See also
- Quick Start: connect to a warehouse and run your first SQL statements.
- Connection Methods: connect with MySQL-compatible clients and drivers.
- Sessions: inspect and terminate active queries.
- Query Audit: investigate completed queries across a warehouse.