Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce EMBEDDING_VIEW function to refer to the embedding entity view #367

Closed
beikov opened this issue Mar 2, 2017 · 5 comments

Comments

@beikov
Copy link
Member

commented Mar 2, 2017

Currently OUTER is handled in the core and allows to refer to the query root of a parent query builder. Within entity views this might not be what people expect. This is only problematic when the subquery provider is in a subview which is why nobody complained too much yet. We should adapt that so that OUTER refers to the embedding entity view i.e. the entity view that uses the subquery provider instead. Referring to the entity view root which is what OUTER does right now can be done by using VIEW_ROOT. Since the entity view root could be changed, we might want to consider adding another macro called QUERY_ROOT that always refers to the query root.

We should document that using OUTER in a subquery within a subquery provider will still resolve to the embedding entity view.

@beikov beikov added this to the 1.2.0 milestone Mar 2, 2017

@beikov beikov self-assigned this Mar 2, 2017

@beikov beikov added this to TODO in 1.2.0.Alpha4 Mar 15, 2017

@Mobe91

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2017

I don't really get your idea. Do you want to have different meanings for OUTER depending on whether it is used in the context of entity views or not? I don't think this would be a good idea.

@beikov

This comment has been minimized.

Copy link
Member Author

commented Apr 26, 2017

Why do you think this is a bad idea? Everyone that used OUTER thought it would refer to the entity of the embedding view, not the query root. The worst of all is, that the wrong use of OUTER might not be apparent because the embedding entity type might have the same attribute as the query root. I say, we either disallow OUTER in entity views or overload it's meaning. Right now it will do more harm by introducing bugs than good.

@Mobe91

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2017

I doubt that having one operator with two meanings is comprehensible. Why not introduce a separate operator OUTER_VIEW? What if a subquery provider provides a subquery with another nested subquery? Then OUTER should have its usual meaning, namely referring to the outer subquery when used in the nested subquery. Accessing the embedding view should be possible independently.

@beikov

This comment has been minimized.

Copy link
Member Author

commented Apr 26, 2017

Ok then what should we name it? OUTER_VIEW? EMBEDDING_VIEW or PARENT_VIEW?

@Mobe91

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2017

I would go for EMBEDDING_VIEW to demarcate it from the OUTER semantics.

@beikov beikov removed this from TODO in 1.2.0.Alpha4 Oct 31, 2017

@beikov beikov changed the title Allow OUTER in a subquery provider to refer to the embedding entity view Introduce EMBEDDING_VIEW function to refer to the embedding entity view Jan 27, 2018

@beikov beikov modified the milestones: 1.2.0, 1.3.0, 1.6.0 Jan 28, 2018

beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018
beikov added a commit to beikov/blaze-persistence that referenced this issue Jul 15, 2018

@beikov beikov closed this in 0036c78 Jul 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.