Files
genai-toolbox/docs/en/resources/sources/spanner.md
Wenxin Du eadb678a7b feat: Support env replacement for tool.yaml (#462)
Environment variable replacement is needed so that users don't have to
hardcode their secrets in configuring `tools.yaml`.
Both formats `$ENV_NAME` and `${ENV_NAME}` are standard ways to declare
an environment variable.
However, some database statement placeholders that are already using the
`$ENV_NAME` format.
Therefore, we only support env var declaration using `${ENV_NAME}` to
disambiguate it from other usages.

Fixes issue: https://github.com/googleapis/genai-toolbox/issues/431
2025-04-23 07:33:02 -04:00

3.0 KiB

title, type, weight, description
title type weight description
Spanner docs 1 Spanner is a fully managed database service from Google Cloud that combines relational, key-value, graph, and search capabilities.

Spanner Source

Spanner is a fully managed, mission-critical database service that brings together relational, graph, key-value, and search. It offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL.

If you are new to Spanner, you can try to create and query a database using the Google Cloud console.

Requirements

IAM Permissions

Spanner uses Identity and Access Management (IAM) to control user and group access to Spanner resources at the project, Spanner instance, and Spanner database levels. Toolbox will use your Application Default Credentials (ADC) to authorize and authenticate when interacting with Spanner.

In addition to setting the ADC for your server, you need to ensure the IAM identity has been given the correct IAM permissions for the query provided. See Apply IAM roles for more information on applying IAM permissions and roles to an identity.

Example

sources:
    my-spanner-source:
        kind: "spanner"
        project: "my-project-id"
        instance: "my-instance"
        database: "my_db"
        # dialect: "googlesql"

Reference

field type required description
kind string true Must be "spanner".
project string true Id of the GCP project that the cluster was created in (e.g. "my-project-id").
instance string true Name of the Spanner instance.
database string true Name of the database on the Spanner instance
dialect string false Name of the dialect type of the Spanner database, must be either googlesql or postgresql. Default: googlesql.