Enable $this parameter in SELECT queries
It is now possible to select yielded output fields in the same query, without needing to use a subquery.
This commit is contained in:
parent
7277e32d88
commit
ba40fd7285
1 changed files with 8 additions and 0 deletions
|
@ -184,6 +184,14 @@ func (d *document) yield(ctx context.Context, stm sql.Statement, output sql.Toke
|
|||
}
|
||||
}
|
||||
|
||||
// Ensure that all output fields are
|
||||
// available in subsequent expressions
|
||||
// using the $this parameter.
|
||||
|
||||
vars := data.New()
|
||||
vars.Set(out.Data(), varKeyThis)
|
||||
ctx = context.WithValue(ctx, ctxKeySpec, vars)
|
||||
|
||||
// Next let's see the field expressions
|
||||
// which have been requested, and add
|
||||
// these to the output document.
|
||||
|
|
Loading…
Reference in a new issue