[eluser]xwero[/eluser]
As i understand mrthopers question correctly he doesn't want to execute the queries so enabling the profiler is no option.
Maybe an easier solution would be having a variable in the AR library that can be set before building the sql statement because the only difference with the view_ methods and the regular methods is the return of the compiled statement and the execution of the statement
Code:
var $view_sql = false;
function get($table = '', $limit = null, $offset = null)
{
if ($table != '')
{
$this->from($table);
}
if ( ! is_null($limit))
{
$this->limit($limit, $offset);
}
$sql = $this->_compile_select();
if($this->view_sql)
{
return $sql;
}
$result = $this->query($sql);
$this->_reset_select();
return $result;
}
In the models you could do
Code:
$this->db->view_sql = true;
$this->db->where('a','b');
echo $this->db->get();