Skip to content

v0.7.1

Choose a tag to compare

@apstndb apstndb released this 10 Jun 14:59
cd4dbe6

Patch release since v0.7.0. Correctness fixes for gcvctor wire strings, SQL INSERT zero-column writes, Spanner CLI / Literal float formatting, and ENUM CAST validation. Documentation-only updates for godoc accuracy and Gemini review styleguide. No compile-time API removals or signature changes. Minimum Go remains 1.24.


Highlights

gcvctor wire string correctness (#225)

  • TimestampValue normalizes to UTC Zulu wire strings (matches Spanner client and TimestampStringValue).
  • JSONValue and PGJSONBValue marshal without HTML character escaping, matching Spanner-emitted JSON wire for fixtures.
  • dbsqlrows/gospanner require bumped to spanvalue v0.7.0 (nested module metadata only).

SQL INSERT zero-column guard (#226)

  • SQLInsertWriter WriteValues / WriteRow now return ErrMissingColumnNames for a registered empty row type, matching WriteGCVs and preventing invalid INSERT INTO t () VALUES (); output.

Float and ENUM literal formatting (#228 / #206)

  • Literal preset: finite integral FLOAT64 values append .0 when the shortest strconv form would lex as INT64 (e.g. 1.0 not 1).
  • Spanner CLI preset: integral finite floats omit the fractional part (1 not 1.000000); non-integral values keep six decimal places (matches spanner-cli).
  • FormatEnumAsCast validates ENUM wire payloads with ParseInt before emitting CAST(... AS ...) SQL.

Documentation (#227, #229)

  • Godoc accuracy sweep for writer, gcvctor, and dbsqlrows (no behavior change).
  • Gemini styleguide: clarify [Type.Method] vs [*Type.Method] doc links.

Upgrading to v0.7.1

From v0.7.0

Compile-time: no signature removals or renames. Additive test coverage only.

Runtime behavior changes (review if you use these patterns or assert golden strings):

Area v0.7.0 v0.7.1
gcvctor.TimestampValue with non-UTC time.Time Local offset in wire string UTC Zulu wire (#225)
gcvctor.JSONValue / PGJSONBValue with <, >, & in JSON HTML-escaped wire (\u003c etc.) Unescaped wire matching Spanner (#225)
SQLInsertWriter write after zero-column PrepareRowType Could emit invalid INSERT ... () VALUES () ErrMissingColumnNames (#226)
Literal preset integral FLOAT64 (e.g. 1.0) Shortest form without .0 1.0 when needed to avoid INT64 lex (#228)
Spanner CLI preset integral floats 1.000000 1 (#228)
ENUM CAST with non-integer wire string Could emit invalid SQL Parse error (#228)

Preset-backed Simple export and typical CSV/JSONL paths are unaffected. Re-golden Literal, Spanner CLI, or hand-built gcvctor fixture tests if you assert the rows above.


Full changelog

v0.7.0...v0.7.1