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

Added support for index by and changing selection set #156

Closed
wants to merge 1 commit into from

Conversation

edefimov
Copy link
Contributor

@edefimov edefimov commented Aug 24, 2017

This PR adds two new specifications with features and resolves #155 :

  1. Support for indexing results by some field:
Spec::andX(
  Speс::indexBy('thing');
);
  1. Adding fields to selection set
Spec::andX(
  Spec::addSelectionSet(['my_field', 'x.another_field'])
);
  1. Replacing selection set with new one
Spec::andX(
  Spec::selectionSet(['my_field' , 'x.another_field'])
);
  1. Aliasing selection set
Spec::andX(
  Spec::selectionSet(['my_field' => 'retVal' ])
);
Spec::andX(
  Spec::addSelectionSet(['my_field' => 'retVal' ])
);

@edefimov edefimov force-pushed the feature-index-selectionset branch 2 times, most recently from e6fd6b1 to 47b1589 Compare August 24, 2017 21:46
@Nyholm
Copy link
Member

Nyholm commented Aug 28, 2017

Thank you. I will try to review it shortly.

@edefimov edefimov force-pushed the feature-index-selectionset branch from 47b1589 to 2fcfef3 Compare April 4, 2019 15:07
@peter-gribanov
Copy link
Member

Thanks for the work you've done.
Our plans have changed. We are currently working on features with operands #169 planned for major release 1.0. You can see the implementation of Selection concept here #172.
I can merge your feature into a minor release, but it will become obsolete with a major release. I would not want that. Sorry.

If you move the IndexBy query modifier to a separate PR, i can merge it.

@peter-gribanov
Copy link
Member

Now you can using select and addSelect in specification:

$spec = Spec::andX(
    Spec::select('my_field'),
    Spec::addSelect('another_field')
)
$spec = Spec::andX(
    Spec::addSelect(Spec::field('another_field', $myDqlAlias))
)
$spec = Spec::andX(
    Spec::select(Spec::selectAs('another_field', 'my_field'))
)
$spec = Spec::andX(
    Spec::select(Spec::selectAs(Spec::value($myValue), 'my_field'))
)

@peter-gribanov
Copy link
Member

@edefimov will you move the query modifier IndexBy to a separate PR? I would want to keep the authorship of this feature for you.

@edefimov
Copy link
Contributor Author

yep, I will do it

@edefimov
Copy link
Contributor Author

edefimov commented May 6, 2019

Separate PR with IndexBy feature: #192

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

Successfully merging this pull request may close these issues.

Add IndexBy support
3 participants