-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat(driver): Google Spanner Driver #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ion, driver, and dialect support - Added Spanner adapter with configuration classes for connection and pool parameters. - Implemented Spanner SQL dialect extending BigQuery dialect to support INTERLEAVE and TTL features. - Created Spanner driver for synchronous operations, including session management and exception handling. - Introduced type conversion for UUID and JSON in SpannerTypeConverter. - Developed data dictionary for querying Spanner metadata. - Added integration tests for connection pooling, session management, and CRUD operations. - Implemented unit tests for configuration validation, driver functionality, and type conversion.
- Updated SpannerDataDictionary to include methods for versioning, feature flags, and optimal type retrieval. - Refactored Spanner dialect to extend BigQuery with Spanner-specific DDL features, including INTERLEAVE and TTL clauses. - Enhanced SpannerSyncDriver to manage connection contexts and improve exception handling. - Introduced SpannerSyncCursor for better session management. - Updated type conversion logic in SpannerTypeConverter for UUID and JSON handling. - Modified integration tests to utilize SpannerSyncDriver and SpannerSyncConfig for consistency. - Added unit tests for Spanner dialect to ensure correct parsing and generation of INTERLEAVE and TTL clauses. - Improved error handling in driver methods to provide clearer feedback on execution issues.
- Added integration tests for CRUD operations in Spanner, including select, insert, update, and delete functionalities. - Enhanced unit tests for SpannerSyncConfig to validate connection handling and session management. - Expanded dialect tests for Spanner to cover various SQL parsing scenarios, including DDL, DML, and advanced queries. - Introduced unit tests for SpannerSyncStore to ensure transaction usage during set and delete operations. - Created new tests for Spangres dialect to validate row deletion policies and ensure proper SQL rendering. - Updated existing tests to reflect changes in TTL and interleave syntax, ensuring compatibility with Spanner's features.
…s for ADK and Litestar session store
- Add sniffio to test dependencies (required by litestar since anyio removed it as a direct dependency) - Rename test_adk_store.py to test_oracle_adk_store.py to avoid pytest module name conflict with spanner's test_adk_store.py
- Add Spanner adapter section to API reference (adapters.rst) - Create custom SQLglot dialect guide (custom-sqlglot-dialects.md) - Update AGENTS.md with custom dialect pattern and spanner in adapter list
Documentation updates: - Add Spanner to drivers_and_querying.rst (overview, driver section, selection guide) - Add Spanner to parameter-profile-registry.md - Add SpannerADKStore to ADK extension guide with example - Add SpannerSyncStore to Litestar extension guide - Update guides README with all adapters including Spanner Skills: - Create comprehensive Spanner adapter skill - Update adapter skills README with Spanner entry - Update main skills README with Spanner
FixedSizePool and other Spanner session pools do not accept a database argument in their constructor. The pool is created standalone and then passed to the Database constructor via the pool= parameter.
- Extension test fixtures (ADK, Litestar) now depend on spanner_database fixture to ensure instance/database are created before use - Fix _infer_param_types and _coerce_params to handle tuple parameters (cached statements can return tuple parameters) - Fix test_crud_operations to use select_one_or_none for deleted row check
ADK Store: - Fix BYTES column to use BYTES(MAX) (required by Spanner DDL) - Check existing tables before DDL to avoid duplicates Litestar Store: - Replace select_one with select_one_or_none for nullable queries - Check existing tables before DDL to avoid duplicates - Remove unused api_exceptions import
- Implemented binary data encoding pattern for Spanner, including functions for converting Python bytes to base64-encoded format and vice versa. - Updated Spanner adapter documentation to reflect new BYTES handling. - Enhanced SpannerSyncConfig to provide batch context instead of transaction for write operations. - Refactored SpannerSyncStore to utilize new encoding functions for session data. - Added integration tests to verify correct handling of bytes with Spanner. - Updated unit tests to ensure proper transaction handling and session management.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements full support for Google Cloud Spanner.
Includes
spangresandspannerSQLGlot dialects that should eventually be considered for an upstream PR once stabilized.