SerializeValue implements the types.ExtendedType interface.
(ctx context.Context, val any)
| 1116 | |
| 1117 | // SerializeValue implements the types.ExtendedType interface. |
| 1118 | func (t *DoltgresType) SerializeValue(ctx context.Context, val any) ([]byte, error) { |
| 1119 | if val == nil { |
| 1120 | return nil, nil |
| 1121 | } |
| 1122 | sqlCtx, _ := ctx.(*sql.Context) // There are cases where it's okay to serialize with a nil SQL context |
| 1123 | if t.SerializationFunc != nil { |
| 1124 | return t.SerializationFunc(sqlCtx, t, val) |
| 1125 | } |
| 1126 | // If there's not a built-in serialization function, then we'll use the `send` function instead |
| 1127 | return t.CallSend(sqlCtx, val) |
| 1128 | } |
| 1129 | |
| 1130 | // DeserializeValue implements the types.ExtendedType interface. |
| 1131 | func (t *DoltgresType) DeserializeValue(ctx context.Context, val []byte) (any, error) { |