parseExprs parses one or more sql expressions.
(exprs []string)
| 342 | |
| 343 | // parseExprs parses one or more sql expressions. |
| 344 | func 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) |
| 357 | func ParseExprs(sql []string) (tree.Exprs, error) { |
no test coverage detected