(pipe *ast.SQLPipe, seq sem.Seq)
| 359 | } |
| 360 | |
| 361 | func (t *translator) sqlFromPipe(pipe *ast.SQLPipe, seq sem.Seq) (sem.Seq, relTable) { |
| 362 | if query, ok := maybeSQLQueryBody(pipe); ok { |
| 363 | seq, scope := t.sqlQueryBody(query, nil, seq, nil) |
| 364 | return scope.endScope(query, seq) |
| 365 | } |
| 366 | if len(seq) > 0 { |
| 367 | panic("semSQLOp: SQL pipes can't have parents") |
| 368 | } |
| 369 | // We pass in type null for initial type here since we know a pipe subquery inside |
| 370 | // of a sql table expression must always have a data source (i.e., it cannot inherit |
| 371 | // data from a parent node somewhere outside of this seq). XXX support for lateral |
| 372 | // join where the input to the pipe might depend on the table-expression to the left |
| 373 | // may change how we wire things up here. |
| 374 | seq, typ := t.seq(pipe.Body, super.TypeNull) |
| 375 | return seq, newTableFromType(typ, t.checker.unknown) |
| 376 | } |
| 377 | |
| 378 | func maybeSQLQueryBody(pipe *ast.SQLPipe) (ast.SQLQueryBody, bool) { |
| 379 | if len(pipe.Body) == 1 { |
no test coverage detected