Skip to main content

Module encode

Module encode 

Source
Available on crate features sink-spanner or source-spanner only.
Expand description

serde_json::Value → Spanner mutation value encoding.

The sink writes arbitrary JSON records, so values are encoded against the destination column type (read once from INFORMATION_SCHEMA). Mutations only carry prost_types::value::Kinds — Spanner infers the type from the table schema — so the object-safe ToKind wrapper EncodedKind is all the mutation builders need.

Structs§

EncodedKind
A pre-encoded mutation value. get_type reports STRING but is never consulted on the mutation path (mutations infer types server-side from the table schema); this wrapper must not be used for statement params.

Functions§

encode_to_kind
Encode one JSON value for a destination column of type ty.