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+.