Skip to content

chore(spanner): deprecate experimental host option/parameter to replace with Spanner Omni#13236

Open
sagnghos wants to merge 2 commits into
googleapis:mainfrom
sagnghos:sagnghos/spannerOmni
Open

chore(spanner): deprecate experimental host option/parameter to replace with Spanner Omni#13236
sagnghos wants to merge 2 commits into
googleapis:mainfrom
sagnghos:sagnghos/spannerOmni

Conversation

@sagnghos
Copy link
Copy Markdown
Contributor

This PR deprecates the experimentalHost / isExperimentalHost option and property across the Cloud Spanner client libraries (SpannerOptions and ConnectionOptions) and introduces a unified type option and connection parameter (supporting the values cloud, omni, and emulator).

To connect to a Spanner Omni instance, users should now use the setType(InstanceType.OMNI) builder option or pass the connection string query parameter ?type=omni.

Refer to discussion: Spanner Client Library Configuration for Omni

Currently, setting the type to cloud or emulator acts as a no-op (since the client library automatically resolves default behaviors for standard cloud and emulator setups). However, introducing this option makes the client library highly extendable, enabling us to enforce or optimize custom behaviors tailored to specific Spanner instance types in the future.

@sagnghos sagnghos requested review from a team as code owners May 20, 2026 12:12
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request rebrands 'experimental host' features as 'Spanner Omni' and introduces a formal InstanceType enum (CLOUD, OMNI, EMULATOR) to manage connection types. The changes include updating configuration constants, renaming internal methods and helper classes, and deprecating older 'experimental host' properties in favor of the new type property. Feedback focuses on the setType(InstanceType.OMNI) implementation, specifically regarding a strict order dependency where setHost must be called before setType, which violates standard builder patterns. Additionally, the current implementation has destructive side effects that can silently overwrite user-provided configurations for project IDs and session pool options, especially when re-invoked through methods like usePlainText().

@sagnghos sagnghos force-pushed the sagnghos/spannerOmni branch from da1d328 to ad29f9b Compare May 20, 2026 12:15
@sagnghos sagnghos force-pushed the sagnghos/spannerOmni branch from 08e3bee to 297835d Compare May 20, 2026 13:27
@sagnghos sagnghos force-pushed the sagnghos/spannerOmni branch from 297835d to a6a228d Compare May 20, 2026 13:33
@sagnghos sagnghos changed the title chore(spanner) : deprecate experimental host option/parameter to replace with Spanner Omni chore(spanner): deprecate experimental host option/parameter to replace with Spanner Omni May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant