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

Function ParseExpr

postgres/parser/parser/parse.go:365–374  ·  view source on GitHub ↗

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

(sql string)

Source from the content-addressed store, hash-verified

363
364// ParseExpr is a short-hand for parseExprs([]string{sql})
365func ParseExpr(sql string) (tree.Expr, error) {
366 exprs, err := parseExprs([]string{sql})
367 if err != nil {
368 return nil, err
369 }
370 if len(exprs) != 1 {
371 return nil, errors.AssertionFailedf("expected 1 expression, found %d", len(exprs))
372 }
373 return exprs[0], nil
374}
375
376// ParseType parses a column type.
377func ParseType(sql string) (tree.ResolvableTypeReference, error) {

Callers 1

ParseTypeFunction · 0.85

Calls 1

parseExprsFunction · 0.85

Tested by

no test coverage detected