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

RFC ORM: Add support to string aggregation #14455

Open
celsowm opened this issue Apr 15, 2020 · 5 comments
Open

RFC ORM: Add support to string aggregation #14455

celsowm opened this issue Apr 15, 2020 · 5 comments
Milestone

Comments

@celsowm
Copy link

@celsowm celsowm commented Apr 15, 2020

Hi folks !
Well, since Cake 4.1 will adopt window functions, I think the timing would be very good to add a very useful feature adopted by all major SGBDs in the last years:

As you can see, there are two different syntaxes: STRING_AGG and GROUP_CONCAT, this article has a very good comparison.

An usage on Cake ORM would be something like:

$q = $this->Classes->find();
$q
    ->select(['description', $q->func()->strAgg('name')])
    ->innerJoinWith('Students')
    ->groupBy('description');

This could be very useful to produce a fast and simple query for reports and similars

  • enhancement
  • feature-discussion (RFC)
@dereuromark dereuromark added this to the 4.1.0 milestone Apr 15, 2020
@dereuromark
Copy link
Member

@dereuromark dereuromark commented Apr 15, 2020

@celsowm Are you interested to make a PR against 4.next branch?

@celsowm
Copy link
Author

@celsowm celsowm commented Apr 15, 2020

Sorry my ignorance, but what is PR?

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Apr 15, 2020

Pull Request (some call it merge request). A change as seen in the tab above.

@celsowm
Copy link
Author

@celsowm celsowm commented Apr 15, 2020

Ah okay, hehe. I can try if you guys give me some tips on which classes I need to add new methods

@othercorey othercorey added the database label Apr 16, 2020
@jimbo2150
Copy link

@jimbo2150 jimbo2150 commented May 12, 2020

Working on this, should have a PR in the next day.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.