title: Codeigniter: Combining activeRecord with manual queries?
body: <p>I've though a bit about the activerecord vs. manual queries in Codeigniter. ActiveRecord is awesome when it's all about standard queries and holds development  time really low.</p>
  
  <p>However, when there's a need to add some complexity to the queries, the ActiveRecord gets quite complicated to work with. Sub queries or complex joins gives atleast me a lot of headache.</p>
  
  <p>Since the current "$this->db->query" -call immediately executes the set query, it can't be combined with normal activeRecord calls. </p>
  
  <p>So, what can I do to combine the two methods? </p>
  
  <p>Example of what I want to accomplish:</p>
  
  <pre><code>$this-&gt;db-&gt;select('title, content, date');
  $this-&gt;db-&gt;from('mytable');
  $this-&gt;db-&gt;manual('UNION'); // My own idea of db-call that appends UNION to the query
  $this-&gt;db-&gt;select('title, content, date');
  $this-&gt;db-&gt;from('mytable2');
  $query = $this-&gt;db-&gt;get();
  </code></pre>
  
  <p>Thanks!</p>