MCPcopy Create free account
hub / github.com/pingcap/tidb / FormatSQLDatum

Function FormatSQLDatum

pkg/ttl/sqlbuilder/sql.go:56–63  ·  view source on GitHub ↗

FormatSQLDatum formats the datum to a value string in sql

(d types.Datum, ft *types.FieldType)

Source from the content-addressed store, hash-verified

54
55// FormatSQLDatum formats the datum to a value string in sql
56func FormatSQLDatum(d types.Datum, ft *types.FieldType) (string, error) {
57 var sb strings.Builder
58 ctx := format.NewRestoreCtx(format.DefaultRestoreFlags, &sb)
59 if err := writeDatum(ctx, d, ft); err != nil {
60 return "", err
61 }
62 return sb.String(), nil
63}
64
65type sqlBuilderState int
66

Callers 1

TestFormatSQLDatumFunction · 0.92

Calls 3

NewRestoreCtxFunction · 0.92
writeDatumFunction · 0.85
StringMethod · 0.65

Tested by 1

TestFormatSQLDatumFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…