Can I use window functions in doctrine 2?

doctrine-orm, postgresql, symfony, window-functions

Solution

There is no support for this vendor specific function in Doctrine. Either create a custom DQL function or use Native SQL.

Problem

``` SELECT invoice.id, COUNT(slip.id), SUM(projected_minutes) OVER (PARTITION BY task.id) AS projected_minutes FROM invoice INNER JOIN task ON task.invoice_id = invoice.id LEFT JOIN slip ON slip.task_id = task.id ``` The query above is in postgresql, and I want to convert it to DQL, but I cant find any documentation for window functions in DQL, is this natively supported in doctrine or would i have to create a custom dql function for this?

Original source