Support for composite keys on groupBy caluse #6837

Open
opened 2026-01-22 15:39:48 +01:00 by admin · 0 comments
Owner

Originally created by @exeba on GitHub (Sep 28, 2021).

Feature Request

Avoid throwing QueryException::associationPathCompositeKeyNotSupported in groupBy clause

Q A
New Feature yes
RFC yes/no
BC Break no

Summary

In orm/lib/Doctrine/ORM/Query/SqlWalker.php walkPathExpression() we find:

                // COMPOSITE KEYS NOT (YET?) SUPPORTED
                if (count($assoc['sourceToTargetKeyColumns']) > 1) {
                    throw QueryException::associationPathCompositeKeyNotSupported();
                }

I don't know the reason of this constraint, but as log as group by are concerned, it seems to me that it would do no harm to allow it.
Is there any reason why this is not the case?

Originally created by @exeba on GitHub (Sep 28, 2021). ### Feature Request Avoid throwing `QueryException::associationPathCompositeKeyNotSupported` in groupBy clause | Q | A |------------ | ------ | New Feature | yes | RFC | yes/no | BC Break | no #### Summary In `orm/lib/Doctrine/ORM/Query/SqlWalker.php` `walkPathExpression()` we find: ``` // COMPOSITE KEYS NOT (YET?) SUPPORTED if (count($assoc['sourceToTargetKeyColumns']) > 1) { throw QueryException::associationPathCompositeKeyNotSupported(); } ``` I don't know the reason of this constraint, but as log as group by are concerned, it seems to me that it would do no harm to allow it. Is there any reason why this is not the case?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6837