It's not clear how to run a query (or conduct an API call) to list all tables. Is this possible with Spanner?
Use a bash terminal, on Cloud Shell or on your computer, with mysql client already installed. then run the command gcloud sql connect to connect the database; the mysql client is automatically run by this command. After logged in into the database, you can perform a use <database>; and a show tables; to explore it.
There are two types of tables in Spanner: root tables (sometimes called top-level tables), and interleaved tables. Interleaved tables are defined by specifying another table as its parent, causing rows in the interleaved table to be clustered with the parent row.
Cloud Spanner is a fully managed, mission-critical, relational database service that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: Google Standard SQL (ANSI 2011 with extensions) and PostgreSQL.
You can write a query which selects rows from a parent table and interleaved tables at once with SELECT AS STRUCT subqueries. This allows you to run queries efficiently while consuming less CPU utilization on the Cloud Spanner database.
Cloud Spanner is a fully-managed, horizontally scalable relational database service by Google. One of the unique capabilities of Cloud Spanner is table interleaving, which allows you to define parent-child relationships between tables. The data in interleaved tables are physically co-located and it can improve read and write performance.
A transaction in Cloud Spanner is a set of reads and writes that execute atomically at a single logical point in time across columns, rows, and tables in a database. Cloud Spanner supports these transaction modes:
These types of statements don't always create multiple schema versions, though. Cloud Spanner will try to detect when these types of statements can be optimized to avoid using multiple schema versions, which depends on batching.
Ah, looks like this is documented here: https://cloud.google.com/spanner/docs/information-schema. In particular:
SELECT
t.table_name
FROM
information_schema.tables AS t
WHERE
t.table_catalog = '' and t.table_schema = ''
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With