<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sam Wilson's Website :: Doctrine</title><link>https://twyne.samwilson.id.au/T6</link><atom:link href="https://twyne.samwilson.id.au/T6/rss.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Fri, 07 Aug 2026 19:55:57 +0000</lastBuildDate><item><title>P18</title><description>&lt;p&gt;Oh, maybe it’s not possible!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/faq.html#can-i-sort-by-a-function-for-example-order-by-rand-in-dql"&gt;https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/faq.html#can-i-sort-by-a-function-for-example-order-by-rand-in-dql&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Can I sort by a function (for example ORDER BY RAND()) in DQL?&lt;/p&gt;
&lt;p&gt;No, it is not supported to sort by function in DQL. If you need this functionality you should either use a native-query or come up with another solution. As a side note: Sorting with ORDER BY RAND() is painfully slow starting with 1000 rows.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>https://twyne.samwilson.id.au/P18</link><guid isPermaLink="true">https://twyne.samwilson.id.au/P18</guid><pubDate>Wed, 04 Nov 2020 01:57:00 +0000</pubDate></item><item><title>Election night special</title><description>&lt;p&gt;It’s the middle of the morning here, but that doesn’t matter. I’m attempting to add tags to Twyne (I’d link that, but still haven’t implemented hyperlinks in my Sam-flavoured Markdown). It’s going fine, it’s not a complicated thing to do really, but I’m bumping skulls with Doctrine ORM. I’ve used it before for a couple of projects, but not for a while, and I’d forgotten how frustrating it is to be poking at DQL or a query builder and &lt;em&gt;trying&lt;/em&gt; to make it work — when the equivalent SQL is simple and easy! I wouldn’t mind if this was something complicated, but ordering by the count of a joined table shouldn’t take an hour to figure out.&lt;/p&gt;</description><link>https://twyne.samwilson.id.au/P17</link><guid isPermaLink="true">https://twyne.samwilson.id.au/P17</guid><pubDate>Wed, 04 Nov 2020 01:42:00 +0000</pubDate></item></channel></rss>
