feat(spanner): support Scan from string to NullUUID#14128
Conversation
There was a problem hiding this comment.
Code Review
This pull request successfully adds support for scanning string and pointer-to-string values into a NullUUID type, enhancing its flexibility. The error message for invalid types has also been improved to include the type information, which is helpful for debugging. The new test case TestScanNullUUID adequately covers the added functionality.
977b424 to
1294676
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for scanning string values into NullUUID and enhances the Scan methods across various Null* types to correctly handle nil pointer inputs. The changes ensure that when a nil pointer is scanned, the Valid field is set to false, and the value field is set to its zero value, improving robustness and consistency, aligning with established patterns for Scan implementations and Valid field usage. A new test file value_scan_test.go has been added to cover the nil pointer scanning scenarios for all Null* types, and value_test.go now includes a test for NullUUID string scanning. Additional assertions are recommended to ensure comprehensive testing of nil input handling.
Adds support for scanning a string value into a NullUUID. Also fixes multiple incomplete nil checks in the other Scan functions for the various spanner.Null*** types.
1294676 to
ede3ce5
Compare
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v0.8.4 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:ac1efa3ad3c6d99efed878535b3a0fe63d0cce6701c335f03811d8b49004d652 <details><summary>spanner: v1.89.0</summary> ## [v1.89.0](spanner/v1.88.0...spanner/v1.89.0) (2026-03-26) ### Features * Add E2E fallback to the spanner client. (#13518) ([16af6a1](16af6a1c)) * include cache updates and routing hint into BeginTransaction and Commit request/response respectively (PiperOrigin-RevId: 878019893) ([9c80b8b](9c80b8b4)) * add SI, adapt, split point related proto (PiperOrigin-RevId: 871366927) ([d3eb851](d3eb851d)) * Add gRPC A66/A94 metrics (#13825) ([d695802](d695802a)) * support Scan from string to NullUUID (#14128) ([d897b6d](d897b6db)) ### Bug Fixes * replace multiplexed session request loop with shared in-flight creation (#14215) ([3e3bd2d](3e3bd2d3)) * guard rollback when aborted commit cleared session handle (#14218) ([6315105](63151055)) ### Documentation * A comment for field `routing_hint` in messages `.google.spanner.v1.ResultSet` and `.google.spanner.v1.PartialResultSet` are changed (PiperOrigin-RevId: 878019893) ([9c80b8b](9c80b8b4)) * A comment in message `.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode` is changed (PiperOrigin-RevId: 878019893) ([9c80b8b](9c80b8b4)) * A comment for message `ListCloudInstancesAction` is changed (PiperOrigin-RevId: 871366927) ([d3eb851](d3eb851d)) * A comment for field `execution_options` in message `.google.spanner.executor.v1.StartTransactionAction` is changed (PiperOrigin-RevId: 871366927) ([d3eb851](d3eb851d)) * A comment for message `TransactionExecutionOptions` is changed (PiperOrigin-RevId: 871366927) ([d3eb851](d3eb851d)) </details>
Adds support for scanning a string value into a NullUUID.
Also adds typed nil checks to other Scan functions.