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

Function parseExprs

postgres/parser/parser/parse.go:344–354  ·  view source on GitHub ↗

parseExprs parses one or more sql expressions.

(exprs []string)

Source from the content-addressed store, hash-verified

342
343// parseExprs parses one or more sql expressions.
344func parseExprs(exprs []string) (tree.Exprs, error) {
345 stmt, err := ParseOne(fmt.Sprintf("SET ROW (%s)", strings.Join(exprs, ",")))
346 if err != nil {
347 return nil, err
348 }
349 set, ok := stmt.AST.(*tree.SetVar)
350 if !ok {
351 return nil, errors.AssertionFailedf("expected a SET statement, but found %T", stmt)
352 }
353 return set.Values, nil
354}
355
356// ParseExprs is a short-hand for parseExprs(sql)
357func 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