useExplicitView projects the result type using the view explicitly set on the attribute if any.
()
| 195 | // useExplicitView projects the result type using the view explicitly set on the |
| 196 | // attribute if any. |
| 197 | func (rt *ResultTypeExpr) useExplicitView() { |
| 198 | if view, ok := rt.Meta.Last(ViewMetaKey); ok { |
| 199 | p, err := Project(rt, view) |
| 200 | if err != nil { |
| 201 | panic(err) // bug - presence of view meta should have been validated before |
| 202 | } |
| 203 | *rt = *p |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | // ensureDefaultView builds the default view if not explicitly defined. |
| 208 | func (rt *ResultTypeExpr) ensureDefaultView() { |