Select and order columns should be instantly resolved
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1
- Forks
- 1
- Avg merge
- 1h 26m
- Merged PRs (30d)
- 1
Description
Currently a call to Query::with() is mandatory (see https://github.com/Icinga/ipl-orm/commit/7dc53f1e4a4214444dd575e3c58c3f777cc6e34b) 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Query::with(), Query::columns(), and Query::assembleSelect() to trace when selected-column relations are resolved and how filter optimizations use them. Done means selecting service.vars.flatvalue through columns() resolves the relation immediately, so the explicit with() call is unnecessary while filter optimizations continue to work correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100