You can edit /application/config/database.php and enable the PDO driver:
$db['default']['hostname'] = 'pgsql:localhost'; // or mysql:localhost // or sqlite::memory: $db['default']['dbdriver'] = 'pdo';
If you want to directly connect to an active database connection. This might work, but I'm not a CI developer .. so no guarantees. I tried to understand that the code is rotting the brain , but I suspect that I failed. I am not good at PHP4 + eval() :
$CI = get_instance(); var_dump($CI->db->conn_id);
source share