Releases: apstndb/spancodec
Release list
v0.1.2
Patch release since v0.1.1.
Fixed
- Slice type inference honors element
WithGoTyperegistrations (#1 / #2, found by spanpg as the first external consumer of the injection options):TypeFor[[]big.Rat](WithGoType[big.Rat](PGNumeric))now returnsARRAY<PG_NUMERIC>, matching whatValueOfalready produced. Precedence is identical on both sides: exact[]Tregistration > element registration > client mirror. With no options nothing changes (pinned). Consumers can drop slice-type registration workarounds.
Added
WithTypedValueEncoder[T](typ, f)(#3) — the pre-composedWithValueEncoder+WithGoTypepair, surveyed from spanpg'sEncodeOptions(encoder registrations almost always want both halves).
Requirements
Unchanged from v0.1.1: spanvalue v0.7.3+ (v0.7.4+ for writer.WriteRowSeq streaming), spanner v1.84.1 MVS floor (mirrored semantics track v1.91.0), Go 1.24+.
v0.1.1
Patch release since v0.1.0. No code changes.
Go floor relaxed to 1.24
v0.1.0 declared go 1.25.0, inherited from spanenc's initial scaffold where transitive dependencies fetched at then-latest (OpenTelemetry v1.43, golang.org/x/net v0.52, golang.org/x/crypto v0.49, ...) declare go 1.25.0 and forced the main-module directive up. No API in this module requires Go 1.25. This release drops the inflated indirect pins and re-tidies the graph at the MVS minimums implied by the direct dependencies — matching spanvalue, which holds its floor at go 1.24.0 — so downstream modules keep control of both dependency versions and the Go floor.
Requirements
- Go 1.24+ (was 1.25 in v0.1.0).
- Unchanged from v0.1.0 otherwise:
github.com/apstndb/spanvaluev0.7.3+ (v0.7.4+ forwriter.WriteRowSeqstreaming),cloud.google.com/go/spannerv1.84.1 MVS floor (mirrored semantics track v1.91.0).
v0.1.0
First release. spancodec merges and supersedes spanenc (last standalone release: v0.3.2) and spandec (never released standalone) into a single codec module: encoding mirrors the client's internal encodeValue semantics (tracked at cloud.google.com/go/spanner v1.91.0), decoding delegates to the client with extension shapes for destinations it rejects today.
Carried over
- Everything in spanenc v0.3.2:
ValueOf,TypeFor/TypeFromGoType,StructColumns,RowTypeFor,ResultSetMetadataFor,StructColumnsAndValues,RowEncoder[T](Values/Row/Rows/MustResultSetMetadata),MutationColumnsAndValues/MutationMap/ParamsMapwith column masks,ValuesFromSlice/ArrayValueFromSlice,WithLossOfPrecisionHandling,WithValueEncoder/WithGoType. - All of spandec:
Decode,ToStruct(client-delegating, with the*Tnamed-scalar pointer /[]Tstruct slice /json.RawMessageextensions tied to googleapis/google-cloud-go#12576 / #11090 / #10720),WithValueDecoder.
Breaking changes relative to spanenc v0.3.x (batched into the rename)
NewRowEncoder[T](opts ...RowEncoderOption)—RowEncoderOptionis the union interface satisfied by bothColumnMaskOptionandEncodeOption. Construction-timeWithValueEncoder/WithGoTyperegistrations now informRowType/ResultSetMetadata, and per-callValuesoptions layer on a map-cloned copy (encoder state never mutates; safe for concurrent use). Existing call sites compile unchanged unless they spread a[]ColumnMaskOption. Resolves apstndb/spanenc#5 phase 2.- Static inference takes options —
TypeFor/TypeFromGoType/RowTypeFor/RowTypeFromGoType/ResultSetMetadataFor/ResultSetMetadataFromGoTypeacceptopts ...EncodeOption;WithGoTyperegistrations win over inference (fresh clone returned) and resolve[]Tvia the element registration. - One
ErrFallthroughfor both directions (spanenc and spandec each had their own).
See the README migration table.
Requirements
github.com/apstndb/spanvaluev0.7.3+ (gcvctor client-compatibleJSONFromNullable/PGJSONBFromNullable); streamingRowEncoder.Rowsthroughwriter.WriteRowSeqneeds v0.7.4+.github.com/apstndb/structfieldsv0.1.0 /structfields/spannertagv0.1.0.cloud.google.com/go/spanner: go.mod declares only the v1.84.1 MVS floor (mirrored semantics track v1.91.0); your module controls the actual client version.- Go 1.24+.