openproject
openproject copied to clipboard
Code maintenance/53379 separate filtering from projections in queries
Refactors with the following goals:
- separating filtering from projections in queries. That way, the
selects chosen to be displayed can be made responsible for fetching additional information (e.g. by joining another table and selecting values from there) instead of doing it within the query itself or in the table component. This also allows for a more dynamic approach for fetching data. i.e. only when displaying thelatest_activity_atcolumn is that information actually computed - distinguishing between table components that represent a query and those that are handed in rows. With the query object containing most of the information needed (results, selects, orders) and wanting to turn the tables more dynamic, they are the perfect source for building a table based on this information. But not every table is backed by a query so we need to support both ways.
Todos
- [ ] Attempt to separate constructed SQL query into CTEs for readability
- [ ] Finalize separation between table types
https://community.openproject.org/wp/53379 https://community.openproject.org/wp/53315