Inserting and modifying data using the console

The Google Cloud Console provides an interface for inserting, editing, and deleting data in a Cloud Spanner table.

Finding your table

To get started, open a table of Cloud Spanner data in the Cloud Console.

  1. Go to the Cloud Spanner page in the Cloud Console.

    Go to the Spanner page

  2. Click the name of an instance. The instance overview page is displayed.

  3. In the Databases list on this page, click the name of a database.

    Screenshot of databases listed in instance overview

  4. Under Tables, click the name of a table.

    Screenshot of tables listed in database detail page

  5. In the left pane of the Cloud Console, click Data.

    Screenshot of table details page

You can insert, edit, and delete table rows in this tab. See below for detailed instructions.

Inserting data

  1. On the table's Data page, click Insert.

    The Cloud Console displays the table's Query page with a new query tab containing template INSERT and SELECT statements you edit to insert a row in the table and view the result of that insertion.

  2. Edit the INSERT statement to the values you want, and edit the SELECT statement's WHERE clause to match the primary key value of the row you are inserting.

    See INSERT statement and Literals for information about the syntax Cloud Spanner supports.

  3. Click Run.

    Cloud Spanner runs the statements.

Editing data

  1. On the table's Data page, select the row you want to edit, then click Edit.

    The Cloud Console displays the table's Query page with a new query tab containing template UPDATE and SELECT statements you edit to update the row in the table and view the result of that update. Note that the WHERE clauses of both statements denote the row you selected to edit.

  2. Edit the UPDATE statement to reflect the updates you want to make.

    See UPDATE statement and Literals for information about the syntax Cloud Spanner supports.

  3. Click Run.

    Cloud Spanner runs the statements.

Deleting data

  1. On the table's Data page, select one or more rows you wish to delete, then click Delete.

    Need help finding a row? Type its primary key into the filter box.

  2. In the dialog that appears after you click Delete, click CONFIRM.

    The Cloud Console displays the data from your table, which no longer contains the deleted rows.

For an interactive example of inserting and modifying data in a Cloud Spanner table, see the Quickstart using the console.