ParseExprWithInt parses a SQL scalar expression, using the given type when INT is used as type name in the SQL syntax. The caller is responsible for ensuring that the input is, in fact, a valid SQL scalar expression — the results are undefined if the string contains invalid SQL syntax.
(sql string, nakedIntType *types.T)
| 390 | // scalar expression — the results are undefined if the string |
| 391 | // contains invalid SQL syntax. |
| 392 | func ParseExprWithInt(sql string, nakedIntType *types.T) (tree.Expr, error) { |
| 393 | exprs, err := parseExprsWithInt([]string{sql}, nakedIntType) |
| 394 | if err != nil { |
| 395 | return nil, err |
| 396 | } |
| 397 | if len(exprs) != 1 { |
| 398 | return nil, errors.AssertionFailedf("expected 1 expression, found %d", len(exprs)) |
| 399 | } |
| 400 | return exprs[0], nil |
| 401 | } |
| 402 | |
| 403 | // GetTypeReferenceFromName turns a type name into a type |
| 404 | // reference. This supports only “simple” (single-identifier) |
no test coverage detected
searching dependent graphs…