DDC-595: Create query builder from DQL #731

Closed
opened 2026-01-22 12:48:21 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (May 16, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jkleijn:

It would be nice if it were possible to create a QueryBuilder object from DQL or a Query object.

Problem is direct modification of DQL is messy (which is why the QueryBuilder exists), but sometimes you don't have a QueryBuilder object. For example when fetching a named query. Currently, unless I'm missing something, a query cannot be modified. Maybe that's by design, but it's highly impractical.

Originally created by @doctrinebot on GitHub (May 16, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jkleijn: It would be nice if it were possible to create a QueryBuilder object from DQL or a Query object. Problem is direct modification of DQL is messy (which is why the QueryBuilder exists), but sometimes you don't have a QueryBuilder object. For example when fetching a named query. Currently, unless I'm missing something, a query cannot be modified. Maybe that's by design, but it's highly impractical.
admin added the Improvement label 2026-01-22 12:48:21 +01:00
admin closed this issue 2026-01-22 12:48:22 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 16, 2010):

Comment created by @beberlei:

This might be an interesting extension, you would need to convert the AST into a fully configured QueryBuilder. This won't make it into Doctrine 2 Core though probably :-)

@doctrinebot commented on GitHub (May 16, 2010): Comment created by @beberlei: This might be an interesting extension, you would need to convert the AST into a fully configured QueryBuilder. This won't make it into Doctrine 2 Core though probably :-)
Author
Owner

@doctrinebot commented on GitHub (May 16, 2010):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (May 16, 2010): Issue was closed with resolution "Won't Fix"
Author
Owner

@doctrinebot commented on GitHub (May 16, 2010):

Comment created by jkleijn:

Fair enough, I guess this doesn't have too high a priority.

How about a QueryBuilder registry on the EntityManager instead? Then one could use "named QueryBuilders" instead of named queries. Not too high a prio I guess as it's trivial to handle yourself, but I do think a facility in D2 would be appropriate

@doctrinebot commented on GitHub (May 16, 2010): Comment created by jkleijn: Fair enough, I guess this doesn't have too high a priority. How about a QueryBuilder registry on the EntityManager instead? Then one could use "named QueryBuilders" instead of named queries. Not too high a prio I guess as it's trivial to handle yourself, but I do think a facility in D2 would be appropriate
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#731