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

Function ParseExpr

pkg/sql/parser/parse.go:289–298  ·  view source on GitHub ↗

ParseExpr is a short-hand for parseExprs([]string{sql})

(sql string)

Source from the content-addressed store, hash-verified

287
288// ParseExpr is a short-hand for parseExprs([]string{sql})
289func ParseExpr(sql string) (tree.Expr, error) {
290 exprs, err := parseExprs([]string{sql})
291 if err != nil {
292 return nil, err
293 }
294 if len(exprs) != 1 {
295 return nil, errors.AssertionFailedf("expected 1 expression, found %d", len(exprs))
296 }
297 return exprs[0], nil
298}
299
300// ParseType parses a column type.
301func ParseType(sql string) (*types.T, error) {

Callers 4

TestParsePrecedenceFunction · 0.92
TestContainsVarsFunction · 0.92
TestNormalizeExprFunction · 0.92
ParseTypeFunction · 0.85

Calls 1

parseExprsFunction · 0.85

Tested by 3

TestParsePrecedenceFunction · 0.74
TestContainsVarsFunction · 0.74
TestNormalizeExprFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…