title: CodeIgniter returns all fields as strings
body: <p>I have this query in CodeIgniter:</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("
        SELECT u.id
             , u.first_name, u.last_name
             , u.email_address
             , g.id AS group_id
             , g.name AS group_name
             , g.human_readable_name AS human_readable_group_name
          FROM users AS u
          JOIN groups AS g
            ON u.group_id = g.id
      ORDER BY u.last_name
  ");
  
  return $query-&gt;result();
  </code></pre>
  
  <p>When I <code>var_dump</code> a row, I get this:</p>
  
  <pre><code>object(stdClass)#22 (4) {
    ["id"]=&gt;
    string(2) "19"
    ["first_name"]=&gt;
    string(9) "rightfold"
    // etc
  }
  </code></pre>
  
  <p><code>id</code> and <code>group_id</code> are both <code>integer</code>s in PostgreSQL, but <code>$query-&gt;result()</code> returns them as strings. How can I tell CodeIgniter to return fields using the correct data types (<code>text</code>s as strings, <code>integer</code>s as integers, <code>timestamp</code>s as <code>DateTime</code> objects, etc…)?</p>
  
  <p>I'm using CodeIgniter 2.1.4 on PHP 5.3.15.</p>