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 that are described on the [Enabling secure database access](https://docs.cloud.google.com/looker/docs/2622/enabling-secure-db-access.md.txt) documentation page.

## Getting the connection credentials

1. Log in to the [Google Cloud console](https://console.cloud.google.com/).

2. Select the appropriate project.

3. From the menu, select **IAM \& Admin** and then **Service accounts**.

4. 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**.

   ![](https://docs.cloud.google.com/static/looker/docs/images/setup-google-spanner-create-service-account-524.png)
5. 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

   ![](https://docs.cloud.google.com/static/looker/docs/images/setup-google-spanner-account-created-524.png)

## 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](https://docs.cloud.google.com/looker/docs/2622/connecting-to-your-db.md.txt) 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](https://docs.cloud.google.com/looker/docs/2622/connecting-to-your-db.md.txt#max_connections) 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** : Add any additional JDBC parameters. See the [Supported JDBC parameters](https://docs.cloud.google.com/looker/docs/2622/db-config-cloud-spanner.md.txt#jdbc-supported) section on this page for a list of supported parameters.

To verify that the connection is successful, click the **Test Connection** button in the **Status details** section at the bottom of the **Connections Settings** page.

If Looker displays **Can Connect** , press **Connect** to create the connection.

Your database connection is then added to the list on the Looker [**Connections**](https://docs.cloud.google.com/looker/docs/2622/admin-panel-database-connections.md.txt) **Admin** page.

## Supported JDBC parameters

For Google Spanner {: #google}, Looker supports the following JDBC parameters in the [**Additional JDBC parameters**](https://docs.cloud.google.com/looker/docs/2622/connecting-to-your-db.md.txt#additional_jdbc_parameters) field for the connection. See the documentation for your database for information on these parameters.

- `autocommit`
- `autoConfigEmulator`
- `endpoint`
- `maxSessions`
- `minSessions`
- `numChannels`
- `oauthToken`
- `optimizerVersion`
- `readonly`
- `retryAbortsInternally`
- `rpcPriority`
- `usePlainText`

## Feature support

For Looker to support some features, your database dialect must also support them.

Google Spanner supports the following features as of Looker 26.22:

| Feature | 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 |
| Time zones | 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 2.0 credentials | No |
| Context comments | Yes |
| Connection pooling | No |
| HLL sketches | No |
| Aggregate awareness | No |
| Incremental PDTs | No |
| Milliseconds | No |
| Microseconds | No |
| Materialized views | No |
| Period-over-period measures | No |
| Approximate count distinct | No |
| In-database analytic models | No |
| Custom calendars | No |

## References

- [Documented Spanner limits](https://docs.cloud.google.com/spanner/docs/limits)

- [Google Spanner IAM documentation](https://docs.cloud.google.com/spanner/docs/iam.md.txt)

## Next steps

After you have connected your database to Looker, [configure sign-in options for your users](https://docs.cloud.google.com/looker/docs/2622/getting-started-with-users.md.txt).