Spanner Source
2 minute read
About
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.
Available Tools
Spanner Source Tools
| Tool Name | Description |
|---|---|
| spanner-execute-sql Tool | A "spanner-execute-sql" tool executes a SQL statement against a Spanner database. |
| spanner-sql Tool | A "spanner-sql" tool executes a pre-defined SQL statement against a Google Cloud Spanner database. |
| spanner-list-graphs Tool | A "spanner-list-graphs" tool retrieves schema information about graphs in a Google Cloud Spanner database. |
| spanner-list-tables Tool | A "spanner-list-tables" tool retrieves schema information about tables in a Google Cloud Spanner database. |
Pre-built Configurations
- Spanner using MCP Connect your IDE to Spanner using Toolbox.
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
kind: sources
name: my-spanner-source
type: "spanner"
project: "my-project-id"
instance: "my-instance"
database: "my_db"
# dialect: "googlesql"
Reference
| field | type | required | description |
|---|---|---|---|
| type | 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. |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.