MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Unmarshal

Method Unmarshal

pkg/sql/types/types.go:2444–2452  ·  view source on GitHub ↗

Unmarshal deserializes a type from the given byte representation using gogo protobuf serialization rules. It is backwards-compatible with formats used by older versions of CRDB. var t T err := protoutil.Unmarshal(data, &t) Unmarshal is part of the protoutil.Message interface.

(data []byte)

Source from the content-addressed store, hash-verified

2442//
2443// Unmarshal is part of the protoutil.Message interface.
2444func (t *T) Unmarshal(data []byte) error {
2445 // Unmarshal the internal type, and then perform an upgrade step to convert
2446 // to the latest format.
2447 err := protoutil.Unmarshal(data, &t.InternalType)
2448 if err != nil {
2449 return err
2450 }
2451 return t.upgradeType()
2452}
2453
2454// upgradeType assumes its input was just unmarshaled from bytes that may have
2455// been serialized by any previous version of CRDB. It upgrades the object

Callers

nothing calls this directly

Calls 2

upgradeTypeMethod · 0.95
UnmarshalFunction · 0.92

Tested by

no test coverage detected