Skip to content

Comments

feat(spanner): Improve and extend support for Spanner Client#247

Open
aseering wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
aseering:feat-spanner-native-support
Open

feat(spanner): Improve and extend support for Spanner Client#247
aseering wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
aseering:feat-spanner-native-support

Conversation

@aseering
Copy link

Extend the Spanner Client to be more robust and more featureful.

  • Support both Spanner PG and Spanner GSQL databases
  • Support connecting to the Spanner Emulator, and for launching a managed instance of the Spanner Emulator (important for large test runs where it becomes necessary to stop/start the Emulator process regularly to deal with deliberate memory leaks)
  • Clean up some PG-isms
  • Switch to using the native Spanner Python Client. I didn't end up needing this -- could try to put it back if you prefer -- but it let me play around with using mutations for data ingest

@google-cla
Copy link

google-cla bot commented Feb 21, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Replaces the SQLAlchemy-based implementation with a native Google Cloud Spanner client to improve stability and support for PostgreSQL dialects.

- Implements native  and  using  queries.
- Adds robust  with multi-pass retry logic for Foreign Key cycles and proper quoting for case-sensitive Postgres tables.
- Implements high-performance  using the Mutation API with type-aware processing.
- Adds support for .
- Updates SQLGenBasePromptGenerator to detect Spanner dialect (GoogleSQL vs PostgreSQL) from db config.
- Adds specific prompt templates for Spanner GoogleSQL (using backticks) and Spanner PostgreSQL (using quotes).
@aseering aseering force-pushed the feat-spanner-native-support branch from 474ad8d to 2c8df8a Compare February 21, 2026 03:55
Copy link
Collaborator

@IsmailMehdi IsmailMehdi left a comment

Choose a reason for hiding this comment

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

it would be good to have a run config that showcases the emulator.

Copy link
Collaborator

@IsmailMehdi IsmailMehdi left a comment

Choose a reason for hiding this comment

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

please take a look at the style issues.

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.

2 participants