Insert and modify data using the Google Cloud console

Stay organized with collections Save and categorize content based on your preferences.

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

Find a table

To get started, select to view a Spanner table in the Google Cloud console.

  1. Go to the Spanner page in the Google Cloud console.

    Go to the Spanner page

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

    Screenshot of databases listed in instance overview

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

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

    Screenshot of tables listed in database detail page

  5. In the left pane of the Google Cloud console, click Data.

    Screenshot of table details page

Insert data

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

    The Google Cloud console displays the table's Query page with a new query tab containing template INSERT and SELECT statements that 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 Spanner supports.

  3. Click Run.

    Spanner runs the statements.

Edit data

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

    The Google 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 Spanner supports.

  3. Click Run.

    Spanner runs the statements.

Delete data

  1. On the table's Data page, select one or more rows that you want 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 Google 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 Spanner table, see the Quickstart using the console.