After trying without success to use _compiled_select()
or get_compiled_select()
I just printed the db
object, and you can see the query there in the queries
property.
Try it yourself:
var_dump( $this->db );
If you know you have only one query, you can print it directly:
echo $this->db->queries[0];