MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseDArrayFromString

Function ParseDArrayFromString

pkg/sql/sem/tree/parse_array.go:200–208  ·  view source on GitHub ↗

ParseDArrayFromString parses the string-form of constructing arrays, handling cases such as `'{1,2,3}'::INT[]`. The input type t is the type of the parameter of the array to parse. The dependsOnContext return value indicates if we had to consult the ParseContext (either for the time or the local ti

(
	ctx ParseContext, s string, t *types.T,
)

Source from the content-addressed store, hash-verified

198// The dependsOnContext return value indicates if we had to consult the
199// ParseContext (either for the time or the local timezone).
200func ParseDArrayFromString(
201 ctx ParseContext, s string, t *types.T,
202) (_ *DArray, dependsOnContext bool, _ error) {
203 ret, dependsOnContext, err := doParseDArrayFromString(ctx, s, t)
204 if err != nil {
205 return ret, false, MakeParseError(s, types.MakeArray(t), err)
206 }
207 return ret, dependsOnContext, nil
208}
209
210// doParseDArrayFromString does most of the work of ParseDArrayFromString,
211// except the error it returns isn't prettified as a parsing error.

Callers 1

ParseAndRequireStringFunction · 0.85

Calls 3

MakeArrayFunction · 0.92
doParseDArrayFromStringFunction · 0.85
MakeParseErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…