SQL implements the types.ExtendedType interface.
(ctx *sql.Context, dest []byte, v interface{})
| 899 | |
| 900 | // SQL implements the types.ExtendedType interface. |
| 901 | func (t *DoltgresType) SQL(ctx *sql.Context, dest []byte, v interface{}) (sqltypes.Value, error) { |
| 902 | if v == nil { |
| 903 | return sqltypes.NULL, nil |
| 904 | } |
| 905 | value, err := sqlString(ctx, t, v) |
| 906 | if err != nil { |
| 907 | return sqltypes.Value{}, err |
| 908 | } |
| 909 | |
| 910 | // TODO: check type |
| 911 | return sqltypes.MakeTrusted(sqltypes.Text, types.AppendAndSliceString(dest, value)), nil |
| 912 | } |
| 913 | |
| 914 | // String implements the types.ExtendedType interface. |
| 915 | func (t *DoltgresType) String() string { |
no test coverage detected