This page explains how to explore and manage your Spanner data using Spanner Studio in the Google Cloud console.
Spanner Studio includes an Explorer pane that integrates with a query editor and a SQL query results table. You can run DDL, DML, and SQL statements from this one interface. For example, instead of configuring a third-party database query tool, you can create a table and immediately query your data using the query editor.
If you're new to Spanner, learn how to create and query a database by using the Google Cloud console.
Explore your data
You can use the Explorer to view, search, and interact with your database objects. You can create, alter, and delete the following database objects:
- Tables
- Columns
- Indexes and keys
- Change streams
- ML models hosted on Vertex AI
- Roles
- Views
- Placements (in preview)
- Graphs
You can use the search field in the Explorer pane to search for database objects by name in your projects. The search finds resources that directly match, or contain matches, to your search query. If your search term matches too many resources in a database object level, the result might not show all matches. Narrow your search term, and search again.
To access the Explorer, follow these steps:
In the Google Cloud console, open the Spanner page.
Select an instance from the list.
Select a database.
In the navigation menu, click Spanner Studio. The Explorer pane displays a list of the objects in your database.
Create, modify, and query your data
Using the query editor, you can run any combination of DDL, DML, and SQL statements. Statements must be separated by a semicolon. You can compose a query yourself, or you can populate the query editor with a template.
Statements are executed based on the order in which you enter them in the query editor. Consecutive DDL statements are batched and sent for execution all at once. For more information, see Order of execution of statements in batches.
To structure, modify, or query your data, follow these steps:
In the Google Cloud console, open the Spanner page.
Select an instance from the list.
Select a database.
In the navigation menu, click Spanner Studio.
Compose a query using one of the following methods:
To compose your own query, follow these steps:
- Open a new tab by clicking New SQL editor tab or New tab.
- When the query editor appears, write your query.
To compose a query starting with a template, follow these steps:
- In the Explorer pane, next to a database object, click more_vert View actions. One or more available actions appear.
- Click an action. The query editor populates with a template.
- Replace any placeholders in the template.
Click Run. The results of your query appear in the Results table.