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

Function ParseDArrayFromString

postgres/parser/sem/tree/parse_array.go:170–178  ·  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 ParseTimeContext (either for the time or the loca

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

Source from the content-addressed store, hash-verified

168// The dependsOnContext return value indicates if we had to consult the
169// ParseTimeContext (either for the time or the local timezone).
170func ParseDArrayFromString(
171 ctx ParseTimeContext, s string, t *types.T,
172) (_ *DArray, dependsOnContext bool, _ error) {
173 ret, dependsOnContext, err := doParseDArrayFromString(ctx, s, t)
174 if err != nil {
175 return ret, false, makeParseError(s, types.MakeArray(t), err)
176 }
177 return ret, dependsOnContext, nil
178}
179
180// doParseDArraryFromString does most of the work of ParseDArrayFromString,
181// 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