Skip to content

Remove WITH/CTE column mapping for model#1021

Merged
mvorisek merged 3 commits intodevelopfrom
drop_with_mapping
Jul 9, 2022
Merged

Remove WITH/CTE column mapping for model#1021
mvorisek merged 3 commits intodevelopfrom
drop_with_mapping

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Jul 9, 2022

Mapping duplicated the functionality of Field::$actual, so we drop the WITH mapping from model completely.

Mapping was also used for filtering wanted columns, we drop it as it mutated the source model state and DB query optimizer should be smart enough to prune the unneded columns. Later, we should optimize them away automatically. Alternatively, you can set Model::$onlyFields for the added CTE model manually.

Also, the method was renamed from Model::addWith to Model::addCteModel and name/alias is now accepted as the 1st param.

@mvorisek mvorisek merged commit 43cbe92 into develop Jul 9, 2022
@mvorisek mvorisek deleted the drop_with_mapping branch July 9, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant