This page explains how to set up a connection in Looker to Google Spanner.
Encrypting network traffic
It is a best practice to encrypt network traffic between the Looker application and your database. Consider one of the options described on the Enabling secure database access documentation page.
Getting the connection credentials
Log in to the Google Cloud console.
Select the appropriate project.
From the menu, select IAM & Admin and then Service accounts.
Select Create service account and fill in the dialog box as follows:
- Service account name: Enter
looker-spanner-service
or something similar. - Role: Select Cloud Spanner and then Cloud Spanner Database Reader.
- Furnish a new private key: Select the Furnish a new private key checkbox, and select JSON under Key type.
- Service account name: Enter
Click Create and keep track of the following:
- The email address associated with the service account
- The name and location of the JSON credential file that was downloaded
Creating the Looker connection to your database
In the Admin section of Looker, select Connections, and then click Add Connection.
Fill out the connection details. The majority of the settings are common to most database dialects. See the Connecting Looker to your database documentation page for information. Some of the settings are described next:
- Dialect: Google Spanner.
- Name: The name of the connection.
- Project Name: The project ID for the Google project that contains the Spanner database.
- Instance Name: The name of the instance that contains the Spanner database.
- Database: The name of the Spanner database.
- Schema: Leave this blank.
- Max connections per node: The maximum number of total connections to the Spanner database across all users. The default is 30. This setting can be left at the default value initially. See the Connecting Looker to your database documentation page for more information.
- Connection Pool Timeout: The number of seconds a query will wait before timing out because of a full connection pool.
- Additional JDBC parameters: Any additional JDBC driver parameters.
To verify that the connection is successful, click Test. See the Testing database connectivity documentation page for troubleshooting information.
To save these settings, click Connect.
Feature support
For Looker to support some features, your database dialect must also support them.
Google Spanner supports the following features as of Looker 24.14:
Feature | Supported? |
---|---|
Support Level | Supported |
Looker (Google Cloud core) | Yes |
Symmetric Aggregates | Yes |
Derived Tables | Yes |
Persistent SQL Derived Tables | No |
Persistent Native Derived Tables | No |
Stable Views | No |
Query Killing | Yes |
SQL-based Pivots | No |
Timezones | Yes |
SSL | Yes |
Subtotals | No |
JDBC Additional Params | Yes |
Case Sensitive | Yes |
Location Type | Yes |
List Type | No |
Percentile | No |
Distinct Percentile | No |
SQL Runner Show Processes | No |
SQL Runner Describe Table | No |
SQL Runner Show Indexes | No |
SQL Runner Select 10 | Yes |
SQL Runner Count | Yes |
SQL Explain | No |
Oauth Credentials | No |
Context Comments | Yes |
Connection Pooling | No |
HLL Sketches | No |
Aggregate Awareness | No |
Incremental PDTs | No |
Milliseconds | No |
Microseconds | No |
Materialized Views | No |
Approximate Count Distinct | No |
References
Next steps
After you have connected your database to Looker, configure sign-in options for your users.