MCPcopy Create free account
hub / github.com/dolthub/doltgresql / DeserializeValue

Method DeserializeValue

server/types/type.go:1131–1141  ·  view source on GitHub ↗

DeserializeValue implements the types.ExtendedType interface.

(ctx context.Context, val []byte)

Source from the content-addressed store, hash-verified

1129
1130// DeserializeValue implements the types.ExtendedType interface.
1131func (t *DoltgresType) DeserializeValue(ctx context.Context, val []byte) (any, error) {
1132 if len(val) == 0 {
1133 return nil, nil
1134 }
1135 sqlCtx, _ := ctx.(*sql.Context) // There are cases where it's okay to deserialize with a nil SQL context
1136 if t.DeserializationFunc != nil {
1137 return t.DeserializationFunc(sqlCtx, t, val)
1138 }
1139 // If there's not a built-in deserialization function, then we'll use the `receive` function instead
1140 return t.CallReceive(sqlCtx, val)
1141}
1142
1143// SerializationCompatible implements the val.TupleTypeHandler interface.
1144func (t *DoltgresType) SerializationCompatible(other val.TupleTypeHandler) bool {

Callers 9

deserializeTypeRecordFunction · 0.80
deserializeArrayFunction · 0.80
deserializeAndCompareFunction · 0.80
ConvertSerializedMethod · 0.80
deserializeTypeDomainFunction · 0.80
domain.goFile · 0.80
TestLegacyJsonBRoundTripFunction · 0.80

Calls 1

CallReceiveMethod · 0.95

Tested by 2

TestLegacyJsonBRoundTripFunction · 0.64