DeserializeValue implements the types.ExtendedType interface.
(ctx context.Context, val []byte)
| 1129 | |
| 1130 | // DeserializeValue implements the types.ExtendedType interface. |
| 1131 | func (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. |
| 1144 | func (t *DoltgresType) SerializationCompatible(other val.TupleTypeHandler) bool { |