As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Table API

User friendly container for Cloud Spanner Table.

class google.cloud.spanner_v1.table.Table(table_id, database)[source]

Bases: object

Representation of a Cloud Spanner Table.

Parameters
  • table_id (str) – The ID of the table.

  • database (Database) – The database that owns the table.

exists()[source]

Test whether this table exists.

Return type

bool

Returns

True if the table exists, else false.

reload()[source]

Reload this table.

Refresh any configured schema into schema.

Raises

NotFound – if the table does not exist

property schema

The schema of this table.

Return type

list of Field

Returns

The table schema.

property table_id

The ID of the table used in SQL.

Return type

str

Returns

The table ID.