Skip to main content

Google Spanner

This connector materializes Estuary collections into tables in Google Spanner.

Prerequisites

To use this connector, you'll need:

  • A Google Cloud project with the Spanner API enabled.
  • A Google Cloud Spanner instance and database.
  • Credentials for a service account that can manage your Spanner instance.
  • At least one Estuary collection to materialize.

Configuration

To use this connector, begin with data in one or more Estuary collections. Use the properties below to configure a Google Spanner materialization.

Properties

Endpoint

PropertyTitleDescriptionTypeRequired/Default
/project_idProject IDName of the Google Cloud project containing your Spanner instance for this materialization.stringRequired
/instance_idInstance IDCloud Spanner instance ID.stringRequired
/databaseDatabaseName of the Spanner database to use for the materialization.stringRequired
/hardDeleteHard DeleteIf this option is enabled, items deleted in the source will also be deleted from the destination. Otherwise, _meta/op will indicate soft deletes.booleanfalse
/credentialsCredentialsCredentials used to authenticate with Google.objectRequired
/credentials/service_account_jsonService Account JSONThe JSON key of the service account to use for authorization.stringRequired
/advancedAdvanced OptionsOptions for advanced users.object
/advanced/no_flow_documentExclude Flow DocumentWhen enabled, the root document will not be required for standard updates.booleanfalse
/advanced/disable_key_distribution_optimizationDisable Key Distribution OptimizationWhen enabled, the hash prefix normally added to table keys will be omitted. The hash prefix distributes writes across Spanner splits and avoids hotspots.booleanfalse

Bindings

PropertyTitleDescriptionTypeRequired/Default
/tableTable NameName of the table to publish materialized results to.stringRequired
/schemaAlternative SchemaOptional alternative schema for this table. Overrides the default namespace.string
/additional_table_create_sqlAdditional Table Create SQLAdditional SQL statement(s) to be run in the same transaction that creates the table.string

Sample

materializations:
${PREFIX}/${mat_name}:
endpoint:
connector:
image: ghcr.io/estuary/materialize-spanner:v1
config:
project_id: my_google_cloud_project
instance_id: my_spanner_instance
database: my_db
credentials:
service_account_json: {secret}
bindings:
- resource:
table: table_name
source: ${PREFIX}/${source_collection}