[PR #151] DDC-1385 #7784

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

Original Pull Request: https://github.com/doctrine/orm/pull/151

State: closed
Merged: Yes


This branch does multiple things:

  1. Fix how INDEX BY works with mixed results. The index is now on the top level, not inside the mixed result.

  2. Add support for INDEX BY in scalar only queries.

    SELECT u.id, u.name FROM User u INDEX BY u.id
    

The following BC Breaks had to be made:

  1. The hydration format changed when using INDEX BY with either mixed or scalar only results.
  2. ResultSetMapping::$indexByMap is now $dqlAlias => $columnName, not $dqlAlias => $fieldName anymore.

Todos:

  1. Since Hydration uses 'scalars' internally, we should prevent that identification variable name from being used.
  2. Array Hydration scalar only is missing.
  3. Unit-tests for RSM changes, aswell as some more error conditions (Exceptions).
  4. Scalar only array hydration for nested levels?

Please code review.

**Original Pull Request:** https://github.com/doctrine/orm/pull/151 **State:** closed **Merged:** Yes --- This branch does multiple things: 1. Fix how INDEX BY works with mixed results. The index is now on the top level, not inside the mixed result. 2. Add support for INDEX BY in scalar only queries. ``` SELECT u.id, u.name FROM User u INDEX BY u.id ``` The following BC Breaks had to be made: 1. The hydration format changed when using INDEX BY with either mixed or scalar only results. 2. ResultSetMapping::$indexByMap is now $dqlAlias => $columnName, not $dqlAlias => $fieldName anymore. Todos: 1. Since Hydration uses 'scalars' internally, we should prevent that identification variable name from being used. 2. Array Hydration scalar only is missing. 3. Unit-tests for RSM changes, aswell as some more error conditions (Exceptions). 4. Scalar only array hydration for nested levels? Please code review.
admin added the pull-request label 2026-01-22 15:56:48 +01:00
admin closed this issue 2026-01-22 15:56:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7784