Currently a call to Query::with() is mandatory (see 7dc53f1) in order to be able to differentiate a column from being solely used in a filter or from being selected.
Consider the following:
$query = Service::on($this->getDb());
$query->with('service.vars');
$query->columns('service.vars.flatvalue');
$query->where('service.vars.flatname', 'app');
The call to with() here shouldn't be necessary, the call to columns should do so instantly. Instantly because with() does the same and it is required for any filter optimizations to work correctly.
At the moment relations of selected columns are only resolved in Query::assembleSelect(). This is too late and can't be assumed as an requirement for e.g. filter optimizations.
Currently a call to
Query::with()is mandatory (see 7dc53f1) in order to be able to differentiate a column from being solely used in a filter or from being selected.Consider the following:
The call to
with()here shouldn't be necessary, the call tocolumnsshould do so instantly. Instantly becausewith()does the same and it is required for any filter optimizations to work correctly.At the moment relations of selected columns are only resolved in
Query::assembleSelect(). This is too late and can't be assumed as an requirement for e.g. filter optimizations.