title: Does CodeIgniter Datamapper ORM support a MySQL CASE statement in ORDER BY clauses?
body: <p>Using Datamapper 1.8.1-dev for PHP's CodeIgniter, I'm trying to build this query to prioritize one country name at top of the list:</p>
  
  <pre><code>SELECT * FROM countries
  ORDER BY CASE name WHEN 'Australia' THEN 1 ELSE 2 END, name
  </code></pre>
  
  <p>PHP on my Country model (which extends Datamapper):</p>
  
  <pre><code>$countries = new Country();
  $countries-&gt;order_by("CASE name WHEN 'Australia' THEN 1 ELSE 2 END, name");
  $countries-&gt;get_iterated();
  </code></pre>
  
  <p>Datamapper instead parses "CASE" as a table name, building this syntax error query:</p>
  
  <pre><code>SELECT * FROM (`countries`)
  ORDER BY `CASE` name WHEN 'Australia' THEN 1 ELSE 2 END, `countries`.`name`
  </code></pre>
  
  <p>I'm assuming the CASE case isn't being handled since this flow control statement was just added in MySQL 5? Are my only alternatives to either add an <code>order_by</code> column to the <code>countries</code> table or use a PHP sort function after database retrieval?</p>