DDC-701: Code generation for DQL queries #862

Open
opened 2026-01-22 12:53:04 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 20, 2010).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user romanb:

It would be cool to have the possibility to define DQL queries in the mapping documents and let these be precompiled to SQL via a command-line code-generation target that produces for each DQL query the SQL and ResultSetMapping in native PHP code.

This allows people to work without a query cache and maximum performance, on the cost of another code-generation step.

There are already named queries currently but these must be defined in the Configuration at runtime and thus it does not bear any advantages.
I would propose removing this runtime named query facility and replacing it with a "compile-time" one. So that "named queries" are queries defined in the mapping, given a name, which can optionally be precompiled via the CLI. If not precompiled a named query should be handled like a normal query.

Originally created by @doctrinebot on GitHub (Jul 20, 2010). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user romanb: It would be cool to have the possibility to define DQL queries in the mapping documents and let these be precompiled to SQL via a command-line code-generation target that produces for each DQL query the SQL and ResultSetMapping in native PHP code. This allows people to work without a query cache and maximum performance, on the cost of another code-generation step. There are already named queries currently but these must be defined in the Configuration at runtime and thus it does not bear any advantages. I would propose removing this runtime named query facility and replacing it with a "compile-time" one. So that "named queries" are queries defined in the mapping, given a name, which can **optionally** be precompiled via the CLI. If not precompiled a named query should be handled like a normal query.
admin added the New Feature label 2026-01-22 12:53:04 +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#862