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

Method Unmarshal

pkg/sql/types/types.go:1565–1573  ·  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

1563//
1564// Unmarshal is part of the protoutil.Message interface.
1565func (t *T) Unmarshal(data []byte) error {
1566 // Unmarshal the internal type, and then perform an upgrade step to convert
1567 // to the latest format.
1568 err := protoutil.Unmarshal(data, &t.InternalType)
1569 if err != nil {
1570 return err
1571 }
1572 return t.upgradeType()
1573}
1574
1575// upgradeType assumes its input was just unmarshaled from bytes that may have
1576// 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