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

Add subSelect() helper function #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pavarnos
Copy link
Contributor

@pavarnos pavarnos commented Jul 1, 2020

@pavarnos pavarnos requested a review from shadowhand as a code owner July 1, 2020 00:52
Copy link
Owner

@shadowhand shadowhand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would this operate any differently than $select->from(alias($inner, 'x')) ?

@pavarnos
Copy link
Contributor Author

pavarnos commented Aug 3, 2020

no difference
But it makes it explicit and it creates a clean obvious syntax. I spent a couple of hours trying to figure out how to do a subselect: lots of googling until I stumbled across #37 and its related comment: it is not mentioned in your docs anywhere (that i could find) but is a very common thing to want to do.
Maybe think of it as a DX improvement?

@shadowhand
Copy link
Owner

I think it would be better to add an example to the documentation than add another function that does exactly the same thing as alias().

@pavarnos
Copy link
Contributor Author

pavarnos commented Aug 4, 2020

ok. want me to delete this PR?

@shadowhand
Copy link
Owner

Or you can replace this PR with one that updates the docs. Your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants