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

Function parseExprs

pkg/sql/parser/parse.go:268–278  ·  view source on GitHub ↗

parseExprs parses one or more sql expressions.

(exprs []string)

Source from the content-addressed store, hash-verified

266
267// parseExprs parses one or more sql expressions.
268func parseExprs(exprs []string) (tree.Exprs, error) {
269 stmt, err := ParseOne(fmt.Sprintf("SET ROW (%s)", strings.Join(exprs, ",")))
270 if err != nil {
271 return nil, err
272 }
273 set, ok := stmt.AST.(*tree.SetVar)
274 if !ok {
275 return nil, errors.AssertionFailedf("expected a SET statement, but found %T", stmt)
276 }
277 return set.Values, nil
278}
279
280// ParseExprs is a short-hand for parseExprs(sql)
281func ParseExprs(sql []string) (tree.Exprs, error) {

Callers 2

ParseExprsFunction · 0.85
ParseExprFunction · 0.85

Calls 1

ParseOneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…