sqlValues analyzes the values expression which currently cannot depend on the input data (until we add support for lateral joins; then a values clause in the FROM can refer to the left relation).
(values *ast.SQLValues, seq sem.Seq)
| 328 | // on the input data (until we add support for lateral joins; then a values |
| 329 | // clause in the FROM can refer to the left relation). |
| 330 | func (t *translator) sqlValues(values *ast.SQLValues, seq sem.Seq) (sem.Seq, *staticTable) { |
| 331 | exprs := make([]sem.Expr, 0, len(values.Exprs)) |
| 332 | types := make([]super.Type, 0, len(values.Exprs)) |
| 333 | for _, astExpr := range values.Exprs { |
| 334 | e, typ := t.expr(astExpr, super.TypeNull) |
| 335 | exprs = append(exprs, e) |
| 336 | types = append(types, typ) |
| 337 | } |
| 338 | seq = append(seq, sem.NewValues(values, exprs...)) |
| 339 | return seq, t.inferSchema(values, types) |
| 340 | } |
| 341 | |
| 342 | // With type checking integrated into the SQL analysis, the logic here |
| 343 | // can always infer a staticTable. Eventually, this will need to support |
no test coverage detected