v0.7.3
Patch release since v0.7.2. Fixes wire output from JSONFromNullable and PGJSONBFromNullable when Value is a Go string, aligning with the official Spanner client's encodeValue. No compile-time API removals or signature changes. Minimum Go remains 1.24.
Highlights
gcvctor JSON nullable wire fix (#237, #236)
JSONFromNullableandPGJSONBFromNullableno longer pass a GostringValuethrough as raw wire JSON. Both helpers now marshal likeJSONValue/PGJSONBValue: a string becomes a quoted JSON string on the wire, matching the official client.- To store pre-encoded wire JSON as-is (validated and compacted), pass it as
encoding/json.RawMessage— the same convention the client follows. - Package docs and
ExampleJSONFromNullabledocument the string-vs-RawMessage semantics.
Input Value |
v0.7.2 wire | v0.7.3 wire |
|---|---|---|
"x" (string) |
x (invalid JSON) |
"x" |
json.RawMessage("{\"a\":1}") |
{"a":1} |
{"a":1} |
Upgrading to v0.7.3
From v0.7.2
Compile-time: no API removals or signature changes.
Runtime: if you relied on JSONFromNullable / PGJSONBFromNullable treating a Go string Value as pre-encoded wire JSON, switch that input to json.RawMessage. This matches the official client's encoding semantics and fixes invalid wire output for string column round-trips (e.g. spanenc adoption of #232).