Use ON for join conditions for arbitrary DQL joins instead of using WITH #7557

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

Originally created by @stof on GitHub (Oct 7, 2025).

Feature Request

What

DQL supports 2 kinds of joins:

  • relation joins, which can either load the full relation or apply an adhoc condition with WITH
  • arbitrary joins, which today also use the WITH keyword, even though the conditions in this case have exactly the same semantic than the ON conditions of SQL joins

This is about changing that second case (not changing the first one) to support ON as keyword and deprecating the support of WITH for that case

Why

This inconsistency with SQL causes lots of confusion in the ecosystem. The fact that Expr\Join has a ON constant while DQL did not support parsing it causes even more confusion when using the QueryBuilder.
See #7891 and #3544,

How

Change the parsing of JOIN to distinguish the 2 kinds of joins in the handling of conditions.

Originally created by @stof on GitHub (Oct 7, 2025). ### Feature Request #### What DQL supports 2 kinds of joins: - relation joins, which can either load the full relation or apply an adhoc condition with `WITH` - arbitrary joins, which today also use the `WITH` keyword, even though the conditions in this case have exactly the same semantic than the `ON` conditions of SQL joins This is about changing that second case (**not** changing the first one) to support `ON` as keyword and deprecating the support of `WITH` for that case #### Why This inconsistency with SQL causes lots of confusion in the ecosystem. The fact that `Expr\Join` has a `ON` constant while DQL did not support parsing it causes even more confusion when using the QueryBuilder. See #7891 and #3544, #### How Change the parsing of `JOIN` to distinguish the 2 kinds of joins in the handling of conditions.
admin closed this issue 2026-01-22 15:53:25 +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#7557