serializeTypeBytea handles serialization from the standard representation to our serialized representation that is written in Dolt.
(ctx *sql.Context, t *DoltgresType, val any)
| 62 | // serializeTypeBytea handles serialization from the standard representation to our serialized representation that is |
| 63 | // written in Dolt. |
| 64 | func serializeTypeBytea(ctx *sql.Context, t *DoltgresType, val any) ([]byte, error) { |
| 65 | res, err := sql.UnwrapAny(ctx, val) |
| 66 | if err != nil { |
| 67 | return nil, err |
| 68 | } |
| 69 | str := res.([]byte) |
| 70 | writer := utils.NewWriter(uint64(len(str) + 4)) |
| 71 | writer.ByteSlice(str) |
| 72 | return writer.Data(), nil |
| 73 | } |
| 74 | |
| 75 | // deserializeTypeBytea handles deserialization from the Dolt serialized format to our standard representation used by |
| 76 | // expressions and nodes. |