title: Knex.js subqueries on MySQL left join
body: <p>I'm kind of new with Knex.js query builder and I'm currently having trouble with one somehow simple MySQL select. Here it is :</p>
  <pre><code>SELECT orders.*, coalesce(x.unread, 0) AS unread_messages 
  FROM orders
  LEFT JOIN
      (SELECT id_order, COUNT(*) AS unread
       FROM chats
       WHERE read_by_user = 0
       GROUP BY id_order) AS x
  ON x.id_order = orders.id_order
  WHERE id_customer = 42
  ORDER BY date_submitted;
  </code></pre>
  <p>I'm a bit lost reading Knex's doc, but should I use <em>.joinRaw</em> for the join and <em>knex.raw</em> for the coalesce command ?</p>