Skip to content

v0.3.2

Latest

Choose a tag to compare

@apstndb apstndb released this 11 Jun 15:53
9b578f8

Final feature release of spanenc. Development moved to spancodec, which merges spanenc and spandec into a single codec module (see its v0.1.0 release and migration table). spanenc v0.3.x remains usable but frozen; the module carries a Deprecated: notice as of this release.

Added since v0.3.1

  • RowEncoder.MustResultSetMetadata (#3): ResultSetMetadata panicking on error, for package-level wiring next to MustNewRowEncoder — row-type resolution is deterministic per T and column mask, and Must construction alone does not guarantee an inferable row type. Surveyed from apstndb/spanner-mycli#661.
  • Custom value encoders (#5 phase 1): WithValueEncoder[T] registers a per-call encoder for Go types outside the client's coverage (uint32 and other integer width variants, time.Duration, external types that cannot implement spanner.Encoder), consulted before the client mirror; the new ErrFallthrough defers to the built-in encoding. Registrations apply per element of []T; WithGoType[T] supplies the ARRAY element type for nil/empty slices and for ValuesFromSlice/ArrayValueFromSlice static inference. Exact-type matching only; no package-global registry. Hazard (documented and pinned by test): registering time.Time bypasses the spanner.CommitTimestamp sentinel.

#5 phase 2 (construction-time registrations informing RowEncoder.RowType, options on TypeFor/RowTypeFor) ships in spancodec v0.1.0, not here.

Requirements

  • github.com/apstndb/spanvalue v0.7.3+.
  • cloud.google.com/go/spanner: v1.84.1 MVS floor; mirrored semantics track v1.91.0.