Google Spanner
Connect TableR to Google Cloud Spanner over its REST API with an instance path, database name, and OAuth2 access token — via the spanner-driver plugin.
Spanner is reached over the Google Cloud REST API — the connection is provided by the spanner-driver plugin (install it from the plugins page). You identify the target by instance path and database name, and authenticate with an OAuth2 access token.
Overview
TableR calls the Spanner REST API (spanner.googleapis.com) — there is no host/port to run. The host field takes the instance path projects/<project>/instances/<instance>, the database field the database name, and the password field a Google OAuth2 access token. Set SPANNER_EMULATOR_HOST to point at a local emulator instead.
- REST API — reached at spanner.googleapis.com over HTTPS; emulator via SPANNER_EMULATOR_HOST.
- Instance path — the host field carries projects/<p>/instances/<i>, not a hostname.
- OAuth2 token — the password field takes a Google access token; stored in the keyring.
- Plugin-gated — the Spanner card appears once the spanner-driver plugin is installed.
Before you start
- The spanner-driver plugin installed (Plugins → Google Spanner → Install).
- The instance path projects/<project>/instances/<instance>.
- The database name inside that instance.
- A Google OAuth2 access token with Spanner read access.
Connection fields
These fields match TableR's Spanner connection form. The access token is stored in the operating system keyring, never in plain configuration files.
| Field | Required | Default | Notes |
|---|---|---|---|
| Host | Yes | — | The instance path: projects/<project>/instances/<instance>. |
| Database | Yes | — | The database name inside the instance. |
| Password | Yes | — | A Google OAuth2 access token; stored in the OS keyring. |
Connect with the form
- 1Install the Spanner plugin
Open Plugins, find Google Spanner, and install the spanner-driver plugin.
- 2Choose Google Spanner
Open the launcher and pick the Google Spanner card.
- 3Enter the instance path
Use projects/<project>/instances/<instance> in the host field.
- 4Enter the database name
Name the database inside that instance.
- 5Add the access token
Paste a Google OAuth2 access token in the password field; it is saved to the keyring.
- 6Save and connect
Save the profile so it reappears in the launcher, then connect.
Verify the connection
Once connected, open a query tab and run GoogleSQL:
SELECT 1;
SELECT table_name FROM information_schema.tables;If both statements return, the instance path, database, and token are all correct.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Spanner card missing | The spanner-driver plugin is not installed. | Open Plugins and install the Google Spanner driver, then retry. |
| Spanner host must be the instance path projects/<p>/instances/<i> | The host is a hostname instead of an instance path. | Use the full projects/<project>/instances/<instance> form. |
| Spanner database name is required | The database field is empty. | Enter the database name inside the instance. |
| 401 / invalid authentication credentials | Missing or expired OAuth2 access token. | Mint a fresh token (gcloud auth print-access-token) and update the saved password. |
| Instance not found | Wrong project or instance name in the path. | Re-check the projects/<p>/instances/<i> path in the host field. |