Support Spanner Omni in the spanner source

Author: karthitectCreated Sep 30, 2026Updated Sep 30, 2026

Prerequisites

What are you trying to do that currently feels hard or impossible?

Use the spanner source (and the --prebuilt spanner tools) against a Spanner Omni deployment.

The spanner source only accepts project, instance, database, dialect, and useClientOAuth, and always connects to the Cloud Spanner endpoint with Application Default Credentials. There is no way to set an Omni endpoint, TLS/mTLS certificates, or Omni username/password.

The only workaround today is setting SPANNER_EMULATOR_HOST to the Omni endpoint, which forces plaintext with no authentication. That works for a local development Omni, but not for TLS, mTLS, or password-authenticated deployments. It is also a process-wide override.

Suggested Solution(s)

The Go client already supports Omni through spanner.ClientConfig{Type: spanner.OMNI, ...}:

  • UsePlainText, CaCertificateFile, ClientCertificateFile, and ClientKeyFile since v1.93.0.
  • Username and Password (Omni login) in v1.95.1.

Proposal:

  1. Bump cloud.google.com/go/spanner from v1.92.0 to v1.95.1.
  2. Add optional source fields: instanceType (cloud | omni), omniEndpoint, omniUsePlainText, omniCaCertificateFile, omniClientCertificateFile, omniClientKeyFile, omniUsername, omniPassword. The omni prefix marks the Omni-only fields. Pass them through to the client when instanceType: omni, and validate invalid combinations at load time.
  3. Make project and instance optional for Omni (it ignores them), defaulting to default. They stay required for Cloud Spanner.
  4. Return a clear error from spanner-search-catalog for Omni sources, since Omni databases aren't in Knowledge Catalog.
  5. Update the Spanner source and spanner-search-catalog docs.

A follow-up could expose these fields in the spanner prebuilt config through environment variables.

Alternatives Considered

SPANNER_EMULATOR_HOST: plaintext and unauthenticated only (see above).

Additional Details

Implemented in #4198. The integration test runs Spanner Omni 2026.r4-lts in a testcontainer and was also run against plaintext, mTLS, and password-authenticated deployments.