CI2 doesn't have a way to automatically add them and only produces basic queries, not the more complex ones. CI3 is a bit better with that.
I just usually use $this->db->query(raw_sql) for more complex queries.
but you can also use a string in active record for WHEREs, like:
PHP Code:
$this->db
->where('something', 'any')
->where('(something_else = cond2 OR something_new = cond3)');
Would produce:
WHERE something = 'any'
AND (something_else = cond2 OR something_new = cond3)
If cond2 or cond3 are user input, you'd have to db::escape() them manually.