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

Method SQL

server/types/type.go:901–912  ·  view source on GitHub ↗

SQL implements the types.ExtendedType interface.

(ctx *sql.Context, dest []byte, v interface{})

Source from the content-addressed store, hash-verified

899
900// SQL implements the types.ExtendedType interface.
901func (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.
915func (t *DoltgresType) String() string {

Callers 3

rowToBytesFunction · 0.80
jsonb.goFile · 0.80
NormalizeArrayTypeFunction · 0.80

Calls 1

sqlStringFunction · 0.85

Tested by

no test coverage detected