Skip to content

feat(spanner): support Scan from string to NullUUID#14128

Merged
rahul2393 merged 1 commit intomainfrom
scan-null-uuid-from-string
Mar 5, 2026
Merged

feat(spanner): support Scan from string to NullUUID#14128
rahul2393 merged 1 commit intomainfrom
scan-null-uuid-from-string

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

@olavloite olavloite commented Mar 5, 2026

Adds support for scanning a string value into a NullUUID.

Also adds typed nil checks to other Scan functions.

@olavloite olavloite requested review from a team as code owners March 5, 2026 10:33
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Mar 5, 2026
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 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.

@olavloite olavloite force-pushed the scan-null-uuid-from-string branch 2 times, most recently from 977b424 to 1294676 Compare March 5, 2026 10:57
@olavloite
Copy link
Copy Markdown
Contributor Author

/gemini review

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 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.
@olavloite olavloite force-pushed the scan-null-uuid-from-string branch from 1294676 to ede3ce5 Compare March 5, 2026 12:19
@olavloite olavloite requested review from rahul2393 March 5, 2026 12:21
@rahul2393 rahul2393 merged commit d897b6d into main Mar 5, 2026
10 checks passed
@rahul2393 rahul2393 deleted the scan-null-uuid-from-string branch March 5, 2026 18:08
rahul2393 added a commit that referenced this pull request Mar 26, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants