parseExprs parses one or more sql expressions.
(exprs []string)
| 266 | |
| 267 | // parseExprs parses one or more sql expressions. |
| 268 | func parseExprs(exprs []string) (tree.Exprs, error) { |
| 269 | stmt, err := ParseOne(fmt.Sprintf("SET ROW (%s)", strings.Join(exprs, ","))) |
| 270 | if err != nil { |
| 271 | return nil, err |
| 272 | } |
| 273 | set, ok := stmt.AST.(*tree.SetVar) |
| 274 | if !ok { |
| 275 | return nil, errors.AssertionFailedf("expected a SET statement, but found %T", stmt) |
| 276 | } |
| 277 | return set.Values, nil |
| 278 | } |
| 279 | |
| 280 | // ParseExprs is a short-hand for parseExprs(sql) |
| 281 | func ParseExprs(sql []string) (tree.Exprs, error) { |
no test coverage detected
searching dependent graphs…