Use the SQL console
Discover how to use WaveKit’s SQL Console to query your RisingWave data, explore schemas, view query history, and visualize streaming data flows.
WaveKit includes a powerful, web-based SQL Console that allows you to directly interact with the databases within your connected RisingWave clusters. You can execute queries, explore your database objects, view query history, and even visualize streaming data flows.
Configuring database connections for the SQL console
Before you can run queries, you need to tell the SQL Console how to connect to specific databases within your RisingWave instances. This involves defining a “database connection” which uses one of your already configured “cluster connections” (from WaveKit’s Clusters section) and adds specific database credentials.
- Access the SQL Console: From the main WaveKit dashboard, click on the SQL Console card or the corresponding icon (
< >
) in the sidebar. - Open database management: Inside the SQL Console, click the Manage Databases button.
- Add a new database connection:
- The Database Management modal will appear. If this is your first time, it will likely be empty.
- Click the + Add Database button.
- Fill in the Add New Database form:
- Name: A user-friendly name for this specific database connection (for example,
Primary App DB
,Analytics User on Prod RW
). This name will help you identify it in the SQL Console. - Cluster: From the dropdown, select the RisingWave Cluster (that you previously added in WaveKit’s Clusters section) to which this database belongs. This tells WaveKit the host and SQL port to use.
- Username: Enter the database username for connecting to RisingWave (for example,
root
,app_user
). - Password: Provide the password for the specified username.
- Database Name: Specify the name of the database within the RisingWave cluster you want to connect to (for example,
dev
,postgres
,rw_db
).
- Name: A user-friendly name for this specific database connection (for example,
- Click Test Connection to verify that WaveKit can connect to the RisingWave database using these credentials.
- If the test is successful, click Add Database.
- The configured database connection will now be listed in the Database Management modal and will be available for use in the SQL Console. You can add multiple database connections for different databases or users.
- Click Close on the Database Management modal.
SQL console interface overview
The SQL Console has several key areas:
- Database/Schema explorer: Once a database connection is active (for example,
rw (Default Local Cluster)
), this pane allows you to browse your connected RisingWave cluster’s databases, schemas, and objects like tables, views, materialized views (MVs), sources, and sinks. Expanding these items can show columns and their types. - Query editor: This is where you write your SQL queries.
- Tabs: You can open multiple query tabs (for example, Query 1, setup, +) to work on different queries simultaneously.
- The Run Button: Executes the SQL query in the active tab.
- The Background DDL Checkbox: This option may influence how Data Definition Language (DDL) statements (like
CREATE TABLE
) are executed, potentially allowing them to run as background tasks in RisingWave for long-running operations without blocking the console. (Consult RisingWave documentation for specifics on background DDL.)
- Results pane: After executing a query, this area displays the output, organized into tabs:
- Result: Shows the data returned by
SELECT
queries in a tabular format, or success/error messages for DDL/DML statements. - History: Displays a log of queries executed in the current session or tab.
- Streaming Graph: (A key feature for RisingWave!) For queries that define or relate to streaming entities (like Materialized Views, Sources, Sinks), this tab provides a visual representation of the data flow graph, showing dependencies and how data moves between these components. The legend helps identify different entity types.
- Progress: For long-running queries, this tab might show execution progress or status updates.
- Result: Shows the data returned by
Writing and executing queries
- Select your target: Ensure the correct database connection is active or selected for your query tab (the UI will usually show this in the schema explorer or a dropdown near the Manage Databases button).
- Write your SQL: Type your SQL statement into the query editor pane.
- Run the query: Click the Run button or use any available keyboard shortcut.
- View the output: Examine the Result, History, Streaming Graph, or Progress tabs in the results pane as needed.
The SQL Console in WaveKit provides a convenient and integrated way to interact with your RisingWave data directly from your browser, enhancing your development and operational workflows.