MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / MakeDJSON

Function MakeDJSON

pkg/sql/sem/tree/datum.go:2699–2705  ·  view source on GitHub ↗

MakeDJSON returns a JSON value given a Go-style representation of JSON. * JSON null is Go `nil`, * JSON true is Go `true`, * JSON false is Go `false`, * JSON numbers are json.Number | int | int64 | float64, * JSON string is a Go string, * JSON array is a Go []interface{}, * JSON object is a Go map[s

(d interface{})

Source from the content-addressed store, hash-verified

2697// * JSON array is a Go []interface{},
2698// * JSON object is a Go map[string]interface{}.
2699func MakeDJSON(d interface{}) (Datum, error) {
2700 j, err := json.MakeJSON(d)
2701 if err != nil {
2702 return nil, err
2703 }
2704 return &DJSON{j}, nil
2705}
2706
2707var dNullJSON = NewDJSON(json.NullJSONValue)
2708

Callers 1

normalizeMethod · 0.85

Calls 1

MakeJSONFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…